All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fan Li <fanofcode.li@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: write only the pages in range during defragment
Date: Mon, 14 Dec 2015 13:34:00 +0800	[thread overview]
Message-ID: <004a01d13631$1f332d00$5d998700$@samsung.com> (raw)

@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.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
---
 fs/f2fs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 294e715..5fac4f2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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;

-- 
1.7.9.5


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

             reply	other threads:[~2015-12-14  5:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14  5:34 Fan Li [this message]
2015-12-14  5:53 ` [PATCH] f2fs: write only the pages in range during defragment Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004a01d13631$1f332d00$5d998700$@samsung.com' \
    --to=fanofcode.li@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.