f2fs: fix to retrieve inline xattr space
[sfrench/cifs-2.6.git] / fs / iomap.c
index 97cb9d486a7da38527aa8bc7349692fedcce9e70..abdd18e404f8cdd4f85d4e014af1d4a5edf8bbd2 100644 (file)
@@ -1589,12 +1589,14 @@ static void iomap_dio_bio_end_io(struct bio *bio)
        if (should_dirty) {
                bio_check_pages_dirty(bio);
        } else {
-               struct bio_vec *bvec;
-               int i;
-               struct bvec_iter_all iter_all;
+               if (!bio_flagged(bio, BIO_NO_PAGE_REF)) {
+                       struct bvec_iter_all iter_all;
+                       struct bio_vec *bvec;
+                       int i;
 
-               bio_for_each_segment_all(bvec, bio, i, iter_all)
-                       put_page(bvec->bv_page);
+                       bio_for_each_segment_all(bvec, bio, i, iter_all)
+                               put_page(bvec->bv_page);
+               }
                bio_put(bio);
        }
 }