OSDN Git Service

f2fs: make fault injection covering __submit_flush_wait()
authorChao Yu <yuchao0@huawei.com>
Tue, 19 Feb 2019 09:08:18 +0000 (17:08 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 14 Mar 2019 20:58:05 +0000 (13:58 -0700)
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>
fs/f2fs/segment.c

index 6f0bfae..cebfcad 100644 (file)
@@ -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_rw = REQ_OP_WRITE;
        bio->bi_bdev = bdev;
        ret = submit_bio_wait(WRITE_FLUSH, bio);