From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory
Date: Tue, 24 Apr 2018 23:46:13 -0600 [thread overview]
Message-ID: <20180425054613.2700-5-jaegeuk@kernel.org> (raw)
In-Reply-To: <20180425054613.2700-1-jaegeuk@kernel.org>
This is to give a option for user to be able to recover B/foo in the below
case.
mkdir A
sync()
rename(A, B)
creat (B/foo)
fsync (B/foo)
---crash---
Sugessted-by: Velayudhan Pillai <vijay@cs.utexas.edu>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/namei.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index b5f404674cad..fef6e3ab2135 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -973,8 +973,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
f2fs_put_page(old_dir_page, 0);
f2fs_i_links_write(old_dir, false);
}
- if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
+ if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) {
add_ino_entry(sbi, new_dir->i_ino, TRANS_DIR_INO);
+ if (S_ISDIR(old_inode->i_mode))
+ add_ino_entry(sbi, old_inode->i_ino, TRANS_DIR_INO);
+ }
f2fs_unlock_op(sbi);
--
2.17.0.484.g0c8726318c-goog
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2018-04-25 5:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 5:46 [PATCH 1/5] f2fs: give message and set need_fsck given broken node id Jaegeuk Kim
2018-04-25 5:46 ` [PATCH 2/5] f2fs: avoid bug_on on corrupted inode Jaegeuk Kim
2018-04-25 13:01 ` [f2fs-dev] " Chao Yu
2018-04-25 5:46 ` [PATCH 3/5] f2fs: sanity check on sit entry Jaegeuk Kim
2018-04-25 13:02 ` [f2fs-dev] " Chao Yu
2018-04-25 5:46 ` [PATCH 4/5] f2fs: sanity check for total valid blocks Jaegeuk Kim
2018-04-25 13:03 ` [f2fs-dev] " Chao Yu
2018-04-26 15:27 ` Jaegeuk Kim
2018-04-26 15:29 ` [f2fs-dev] [PATCH 4/5 v2] " Jaegeuk Kim
2018-04-27 1:52 ` Chao Yu
2018-04-25 5:46 ` Jaegeuk Kim [this message]
2018-04-25 13:04 ` [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory Chao Yu
2018-04-26 15:32 ` Jaegeuk Kim
2018-04-27 1:41 ` Chao Yu
2018-04-25 12:57 ` [f2fs-dev] [PATCH 1/5] f2fs: give message and set need_fsck given broken node id Chao Yu
2018-04-26 15:25 ` 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=20180425054613.2700-5-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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).