Skip to contentSkip to conversation

f2fs: write only the pages in range during defragment

PATCH In review Fan Li 2 participants 2 messages Dec 14, 2015 F2FS file system

lore
Share & tools
lore

Fan Li

author
#0 lore raw

PATCH 1/1 f2fs: write only the pages in range during defragment

@lend of filemap_write_and_wait_range is supposed to be a "offset in bytes where the range ends (inclusive)". Subtract 1 to avoid writing an extra page.

---
 fs/f2fs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
index 294e715..5fac4f2 100644
@@ -1686,7 +1686,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
 
        /* writeback all dirty pages in the range */
        err = filemap_write_and_wait_range(inode->i_mapping, range->start,
-                                               range->start + range->len);
+                                               range->start + range->len - 1);
        if (err)
                goto out;
 
Signature · 4 lines
1.7.9.5


------------------------------------------------------------------------------
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Fan Li [mailto:[email protected]]
Sent: Monday, December 14, 2015 1:34 PM
To: 'Jaegeuk Kim'
Cc: [email protected]
Subject: [f2fs-dev] [PATCH] f2fs: write only the pages in range during defragment

Quoted 5 lines

@lend of filemap_write_and_wait_range is supposed to be a "offset in bytes where the range ends (inclusive)". Subtract 1 to avoid writing an extra page.

------------------------------------------------------------------------------