summaryrefslogtreecommitdiff
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-29 16:29:22 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-05-07 10:32:24 -0700
commitcb78942b821380913e6810375c9ce72858e64c4f (patch)
tree1106e5e49216f247f4c373192c71a382b9065fe0 /fs/f2fs/dir.c
parentc41f3cc3ae34acdbcec328084b4b74f686c02f0d (diff)
f2fs: inject ENOSPC failures
This patch injects ENOSPC failures. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 6bd059591405..50f42be4ff1a 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -537,6 +537,10 @@ int f2fs_add_regular_entry(struct inode *dir, const struct qstr *new_name,
}
start:
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+ if (time_to_inject(FAULT_DIR_DEPTH))
+ return -ENOSPC;
+#endif
if (unlikely(current_depth == MAX_DIR_HASH_DEPTH))
return -ENOSPC;