diff options
author | Chao Yu <yuchao0@huawei.com> | 2019-02-19 10:08:18 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-03-13 02:59:18 +0100 |
commit | dc37910d4c63296513c5795187d020ad9793822b (patch) | |
tree | 559515930cf705162c171d3afded6dc1f329422d /fs | |
parent | f2fs: fix to retry fill_super only if recovery failed (diff) | |
download | linux-dc37910d4c63296513c5795187d020ad9793822b.tar.xz linux-dc37910d4c63296513c5795187d020ad9793822b.zip |
f2fs: make fault injection covering __submit_flush_wait()
This patch changes to allow failure of f2fs_bio_alloc() in
__submit_flush_wait(), which can simulate flush error in checkpoint()
for covering more error paths.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/f2fs/segment.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index fdd8cd21522f..2537893e9466 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -542,9 +542,13 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) static int __submit_flush_wait(struct f2fs_sb_info *sbi, struct block_device *bdev) { - struct bio *bio = f2fs_bio_alloc(sbi, 0, true); + struct bio *bio; int ret; + bio = f2fs_bio_alloc(sbi, 0, false); + if (!bio) + return -ENOMEM; + bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH; bio_set_dev(bio, bdev); ret = submit_bio_wait(bio); |