f2fs: fix to check current blkaddr in __allocate_data_blocks
authorChao Yu <chao2.yu@samsung.com>
Thu, 12 Mar 2015 09:04:24 +0000 (17:04 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 10 Apr 2015 22:08:42 +0000 (15:08 -0700)
In __allocate_data_blocks, we should check current blkaddr which is located at
ofs_in_node of dnode page instead of checking first blkaddr all the time.
Otherwise we can only allocate one blkaddr in each dnode page. Fix it.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 0057d4baad33e726439effbdda074250194a45ab..ba70a78a396f8f48c693cc54cf08919696cf8c58 100644 (file)
@@ -1066,7 +1066,10 @@ static void __allocate_data_blocks(struct inode *inode, loff_t offset,
                end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));
 
                while (dn.ofs_in_node < end_offset && len) {
-                       if (dn.data_blkaddr == NULL_ADDR) {
+                       block_t blkaddr;
+
+                       blkaddr = datablock_addr(dn.node_page, dn.ofs_in_node);
+                       if (blkaddr == NULL_ADDR) {
                                if (__allocate_data_block(&dn))
                                        goto sync_out;
                                allocated = true;
This page took 0.026565 seconds and 5 git commands to generate.