From 86bd5c622c93509e204b6fb5de6910879fc87a70 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 13 Jul 2021 16:31:40 -0400 Subject: Update bcachefs sources to 787de128a5 bcachefs: Improvements to fsck check_dirents() --- libbcachefs/fs-io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libbcachefs/fs-io.c') diff --git a/libbcachefs/fs-io.c b/libbcachefs/fs-io.c index 2795b37b..ae55453b 100644 --- a/libbcachefs/fs-io.c +++ b/libbcachefs/fs-io.c @@ -1870,8 +1870,6 @@ static long bch2_dio_write_loop(struct dio_write *dio) * bio_iov_iter_get_pages was only able to get < * blocksize worth of pages: */ - bio_for_each_segment_all(bv, bio, iter) - put_page(bv->bv_page); ret = -EFAULT; goto err; } @@ -1939,6 +1937,7 @@ loop: if (likely(!bio_flagged(bio, BIO_NO_PAGE_REF))) bio_for_each_segment_all(bv, bio, iter) put_page(bv->bv_page); + bio->bi_vcnt = 0; if (dio->op.error) { set_bit(EI_INODE_ERROR, &inode->ei_flags); @@ -1961,6 +1960,9 @@ err: if (dio->free_iov) kfree(dio->iter.iov); + if (likely(!bio_flagged(bio, BIO_NO_PAGE_REF))) + bio_for_each_segment_all(bv, bio, iter) + put_page(bv->bv_page); bio_put(bio); /* inode->i_dio_count is our ref on inode and thus bch_fs */ -- cgit v1.2.3