From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 2/3] f2fs: call f2fs_balance_fs for setattr
Date: Mon, 17 Oct 2016 14:56:44 -0700 [thread overview]
Message-ID: <20161017215645.435-2-jaegeuk@kernel.org> (raw)
In-Reply-To: <20161017215645.435-1-jaegeuk@kernel.org>
If inode becomes dirty, we need to check the # of dirty inodes whether or not
further checkpoint would be required.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/file.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 0907efa..e63d0fd 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -694,7 +694,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
err = f2fs_truncate(inode);
if (err)
return err;
- f2fs_balance_fs(F2FS_I_SB(inode), true);
} else {
/*
* do not trim all blocks after i_size if target size is
@@ -723,6 +722,10 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
}
f2fs_mark_inode_dirty_sync(inode);
+
+ /* inode change will produce dirty node pages flushed by checkpoint */
+ f2fs_balance_fs(F2FS_I_SB(inode), true);
+
return err;
}
--
2.8.3
next prev parent reply other threads:[~2016-10-17 22:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 21:56 [PATCH 1/3] f2fs: count dirty inodes to flush node pages during checkpoint Jaegeuk Kim
2016-10-17 21:56 ` Jaegeuk Kim [this message]
2016-10-26 12:06 ` [PATCH 2/3] f2fs: call f2fs_balance_fs for setattr Chao Yu
2016-10-17 21:56 ` [PATCH 3/3] f2fs: keep dirty inodes selectively for checkpoint Jaegeuk Kim
2016-10-20 2:26 ` [PATCH 3/3 v2] " Jaegeuk Kim
2016-11-05 2:44 ` [f2fs-dev] " Chao Yu
2016-11-05 7:02 ` Jaegeuk Kim
2016-10-26 12:05 ` [PATCH 1/3] f2fs: count dirty inodes to flush node pages during checkpoint Chao Yu
2016-11-23 1:27 ` Chao Yu
2016-11-23 1:36 ` Jaegeuk Kim
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=20161017215645.435-2-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).