diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-09-18 16:55:26 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-09 16:20:53 -0700 |
commit | 9cd81ce3c2f01fc599b9156b94b868b4f578698c (patch) | |
tree | c9eda5db2740d8cc45083c7aa81754e5aeaf3715 /fs/f2fs | |
parent | 46c9e1413f3c4ecbbe775e545063e88feb1f9871 (diff) | |
download | op-kernel-dev-9cd81ce3c2f01fc599b9156b94b868b4f578698c.zip op-kernel-dev-9cd81ce3c2f01fc599b9156b94b868b4f578698c.tar.gz |
f2fs: disallow switch extent_cache option dynamically
Swith extent_cache option dynamically when remount may casue consistency
issue between extent cache and dnode page. Fix in this patch to avoid
that condition.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/super.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index f794781..16442ec 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -742,6 +742,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) int err, active_logs; bool need_restart_gc = false; bool need_stop_gc = false; + bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); sync_filesystem(sb); @@ -767,6 +768,14 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) if (f2fs_readonly(sb) && (*flags & MS_RDONLY)) goto skip; + /* disallow enable/disable extent_cache dynamically */ + if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { + err = -EINVAL; + f2fs_msg(sbi->sb, KERN_WARNING, + "switch extent_cache option is not allowed"); + goto restore_opts; + } + /* * We stop the GC thread if FS is mounted as RO * or if background_gc = off is passed in mount |