diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-12-28 17:09:44 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-03 04:27:31 +0100 |
commit | 0a007b97aad6e1700ef5c3815d14e88192cc1124 (patch) | |
tree | 8c21d92988c5fa3fbf253a7c0792ac2cbc26f237 /fs/f2fs/file.c | |
parent | f2fs: return error during fill_super (diff) | |
download | linux-0a007b97aad6e1700ef5c3815d14e88192cc1124.tar.xz linux-0a007b97aad6e1700ef5c3815d14e88192cc1124.zip |
f2fs: recover directory operations by fsync
This fixes generic/342 which doesn't recover renamed file which was fsynced
before. It will be done via another fsync on newly created file.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 1db68f1bcd77..322aab9d91b5 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -165,6 +165,9 @@ static inline enum cp_reason_type need_do_checkpoint(struct inode *inode) cp_reason = CP_FASTBOOT_MODE; else if (sbi->active_logs == 2) cp_reason = CP_SPEC_LOG_NUM; + else if (need_dentry_mark(sbi, inode->i_ino) && + exist_written_data(sbi, F2FS_I(inode)->i_pino, TRANS_DIR_INO)) + cp_reason = CP_RECOVER_DIR; return cp_reason; } |