summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-09-19 18:13:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-26 09:42:47 +0100
commit9213c2b5119ae7cd536b8198ac5ded8c7c74b5c7 (patch)
tree1a4b8d37781262b292602dfbaa37b52be1e81a17 /fs
parent2f958b8e22eca953eef22eece9a018cda96a1e2d (diff)
downloadlinux-artik7-9213c2b5119ae7cd536b8198ac5ded8c7c74b5c7.tar.gz
linux-artik7-9213c2b5119ae7cd536b8198ac5ded8c7c74b5c7.tar.bz2
linux-artik7-9213c2b5119ae7cd536b8198ac5ded8c7c74b5c7.zip
f2fs: put directory inodes before checkpoint in roll-forward recovery
commit 9e1e6df412a28cdbbd2909de5c6189eda4a3383d upstream. Before checkpoint, we'd be better drop any inodes. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/recovery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index b59285f4736c..9b625ca19001 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -597,6 +597,9 @@ out:
set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
mutex_unlock(&sbi->cp_mutex);
+ /* let's drop all the directory inodes for clean checkpoint */
+ destroy_fsync_dnodes(&dir_list);
+
if (!err && need_writecp) {
struct cp_control cpc = {
.reason = CP_RECOVERY,
@@ -604,7 +607,6 @@ out:
write_checkpoint(sbi, &cpc);
}
- destroy_fsync_dnodes(&dir_list);
kmem_cache_destroy(fsync_entry_slab);
return ret ? ret: err;
}