diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-09-26 19:45:55 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-30 17:34:35 -0700 |
commit | 0f34802858e74e708c6d42209811f6d264892c8f (patch) | |
tree | a125a1021d9a2e37df3ef624a4efff1d7606eed5 /fs/f2fs/gc.c | |
parent | 2443b8b363917468e2fb163b34c8f14fe1546251 (diff) | |
download | linux-stable-0f34802858e74e708c6d42209811f6d264892c8f.tar.gz linux-stable-0f34802858e74e708c6d42209811f6d264892c8f.tar.bz2 linux-stable-0f34802858e74e708c6d42209811f6d264892c8f.zip |
f2fs: support checkpoint error injection
This patch adds to support checkpoint error injection in f2fs for testing
fatal error tolerance, it will be useful that it can simulate abnormal
power off by f2fs itself instead of calling godown ioctl by running apps.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index a5c4175376ab..c9b8a67671f1 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -47,6 +47,11 @@ static int gc_thread_func(void *data) continue; } +#ifdef CONFIG_F2FS_FAULT_INJECTION + if (time_to_inject(sbi, FAULT_CHECKPOINT)) + f2fs_stop_checkpoint(sbi, false); +#endif + /* * [GC triggering condition] * 0. GC is not conducted currently. |