summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-30 01:29:22 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2016-05-07 19:32:24 +0200
commitcb78942b821380913e6810375c9ce72858e64c4f (patch)
tree1106e5e49216f247f4c373192c71a382b9065fe0 /fs/f2fs/checkpoint.c
parentf2fs: inject page allocation failures (diff)
downloadlinux-cb78942b821380913e6810375c9ce72858e64c4f.tar.xz
linux-cb78942b821380913e6810375c9ce72858e64c4f.zip
f2fs: inject ENOSPC failures
This patch injects ENOSPC failures. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 9596d61ca6a8..79da86d6cf5c 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -474,6 +474,13 @@ int acquire_orphan_inode(struct f2fs_sb_info *sbi)
int err = 0;
spin_lock(&im->ino_lock);
+
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+ if (time_to_inject(FAULT_ORPHAN)) {
+ spin_unlock(&im->ino_lock);
+ return -ENOSPC;
+ }
+#endif
if (unlikely(im->ino_num >= sbi->max_orphans))
err = -ENOSPC;
else