* [PATCH] f2fs: fix to check current blkaddr in __allocate_data_blocks
@ 2015-03-12 9:04 Chao Yu
0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2015-03-12 9:04 UTC (permalink / raw)
To: Jaegeuk Kim, Changman Lee; +Cc: linux-f2fs-devel, linux-kernel
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>
---
fs/f2fs/data.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 0057d4b..ba70a78 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,
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;
--
2.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-12 9:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 9:04 [PATCH] f2fs: fix to check current blkaddr in __allocate_data_blocks Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox