diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-03-12 05:04:24 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-04-10 18:08:42 -0400 |
commit | d6d4f1cb912d9bcf988a529d0934568d4550f7b5 (patch) | |
tree | a7471ce31d7af5fb1534ee8ecd619ba98fff1696 | |
parent | 0bfcfcca3d4351f129b8c8a73c114c7ffa99228e (diff) |
f2fs: fix to check current blkaddr in __allocate_data_blocks
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>
-rw-r--r-- | fs/f2fs/data.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0057d4baad33..ba70a78a396f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -1066,7 +1066,10 @@ static void __allocate_data_blocks(struct inode *inode, loff_t offset, | |||
1066 | end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode)); | 1066 | end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode)); |
1067 | 1067 | ||
1068 | while (dn.ofs_in_node < end_offset && len) { | 1068 | while (dn.ofs_in_node < end_offset && len) { |
1069 | if (dn.data_blkaddr == NULL_ADDR) { | 1069 | block_t blkaddr; |
1070 | |||
1071 | blkaddr = datablock_addr(dn.node_page, dn.ofs_in_node); | ||
1072 | if (blkaddr == NULL_ADDR) { | ||
1070 | if (__allocate_data_block(&dn)) | 1073 | if (__allocate_data_block(&dn)) |
1071 | goto sync_out; | 1074 | goto sync_out; |
1072 | allocated = true; | 1075 | allocated = true; |