Skip to content

Commit 68e7f31

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: clean up to check bi_status w/ BLK_STS_OK
Check bi_status w/ BLK_STS_OK instead of 0 for cleanup. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 019a891 commit 68e7f31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/f2fs/compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ void f2fs_compress_write_end_io(struct bio *bio, struct page *page)
14831483
f2fs_is_compressed_page(page));
14841484
int i;
14851485

1486-
if (unlikely(bio->bi_status))
1486+
if (unlikely(bio->bi_status != BLK_STS_OK))
14871487
mapping_set_error(cic->inode->i_mapping, -EIO);
14881488

14891489
f2fs_compress_free_page(page);

fs/f2fs/data.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static void f2fs_finish_read_bio(struct bio *bio, bool in_task)
151151
}
152152

153153
dec_page_count(F2FS_F_SB(folio), __read_io_type(folio));
154-
folio_end_read(folio, bio->bi_status == 0);
154+
folio_end_read(folio, bio->bi_status == BLK_STS_OK);
155155
}
156156

157157
if (ctx)
@@ -290,7 +290,7 @@ static void f2fs_read_end_io(struct bio *bio)
290290
if (time_to_inject(sbi, FAULT_READ_IO))
291291
bio->bi_status = BLK_STS_IOERR;
292292

293-
if (bio->bi_status) {
293+
if (bio->bi_status != BLK_STS_OK) {
294294
f2fs_finish_read_bio(bio, intask);
295295
return;
296296
}
@@ -347,7 +347,7 @@ static void f2fs_write_end_io(struct bio *bio)
347347

348348
type = WB_DATA_TYPE(&folio->page, false);
349349

350-
if (unlikely(bio->bi_status)) {
350+
if (unlikely(bio->bi_status != BLK_STS_OK)) {
351351
mapping_set_error(folio->mapping, -EIO);
352352
if (type == F2FS_WB_CP_DATA)
353353
f2fs_stop_checkpoint(sbi, true,

0 commit comments

Comments
 (0)