Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1741936 > unrolled thread

[PATCH 2/5] f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush

Started byChao Yu <yuchao0@huawei.com>
First post2017-09-29 08:10 +0200
Last post2017-09-29 08:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/5] f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush Chao Yu <yuchao0@huawei.com> - 2017-09-29 08:10 +0200

#1741936 — [PATCH 2/5] f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush

FromChao Yu <yuchao0@huawei.com>
Date2017-09-29 08:10 +0200
Subject[PATCH 2/5] f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush
Message-ID<uuWEO-2sN-13@gated-at.bofh.it>
If we failed to issue flush in ->fsync, we need to keep FI_UPDATE_WRITE
flag to make sure triggering flush in next ->fsync.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 224379a9848c..18ca8b305699 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -294,10 +294,12 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
 	remove_ino_entry(sbi, ino, APPEND_INO);
 	clear_inode_flag(inode, FI_APPEND_WRITE);
 flush_out:
-	remove_ino_entry(sbi, ino, UPDATE_INO);
-	clear_inode_flag(inode, FI_UPDATE_WRITE);
 	if (!atomic)
 		ret = f2fs_issue_flush(sbi);
+	if (!ret) {
+		remove_ino_entry(sbi, ino, UPDATE_INO);
+		clear_inode_flag(inode, FI_UPDATE_WRITE);
+	}
 	f2fs_update_time(sbi, REQ_TIME);
 out:
 	trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret);
-- 
2.13.1.388.g69e6b9b4f4a9

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web