diff options
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index fa284d397199..a90c6bc0d129 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -575,16 +575,14 @@ static const struct segment_allocation default_salloc_ops = { | |||
575 | 575 | ||
576 | static void f2fs_end_io_write(struct bio *bio, int err) | 576 | static void f2fs_end_io_write(struct bio *bio, int err) |
577 | { | 577 | { |
578 | const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | ||
579 | struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; | ||
580 | struct bio_private *p = bio->bi_private; | 578 | struct bio_private *p = bio->bi_private; |
579 | struct bio_vec *bvec; | ||
580 | int i; | ||
581 | 581 | ||
582 | do { | 582 | bio_for_each_segment_all(bvec, bio, i) { |
583 | struct page *page = bvec->bv_page; | 583 | struct page *page = bvec->bv_page; |
584 | 584 | ||
585 | if (--bvec >= bio->bi_io_vec) | 585 | if (err) { |
586 | prefetchw(&bvec->bv_page->flags); | ||
587 | if (!uptodate) { | ||
588 | SetPageError(page); | 586 | SetPageError(page); |
589 | if (page->mapping) | 587 | if (page->mapping) |
590 | set_bit(AS_EIO, &page->mapping->flags); | 588 | set_bit(AS_EIO, &page->mapping->flags); |
@@ -593,7 +591,7 @@ static void f2fs_end_io_write(struct bio *bio, int err) | |||
593 | } | 591 | } |
594 | end_page_writeback(page); | 592 | end_page_writeback(page); |
595 | dec_page_count(p->sbi, F2FS_WRITEBACK); | 593 | dec_page_count(p->sbi, F2FS_WRITEBACK); |
596 | } while (bvec >= bio->bi_io_vec); | 594 | } |
597 | 595 | ||
598 | if (p->is_sync) | 596 | if (p->is_sync) |
599 | complete(p->wait); | 597 | complete(p->wait); |