diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 13 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 18 | ||||
-rw-r--r-- | fs/btrfs/volumes.h | 2 | ||||
-rw-r--r-- | fs/buffer.c | 13 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 1 | ||||
-rw-r--r-- | fs/nilfs2/segbuf.c | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_aops.c | 1 |
8 files changed, 10 insertions, 52 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2ef9a4b72d06..0bccf18dc1dc 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1745,7 +1745,7 @@ static void end_workqueue_fn(struct btrfs_work *work) | |||
1745 | bio->bi_private = end_io_wq->private; | 1745 | bio->bi_private = end_io_wq->private; |
1746 | bio->bi_end_io = end_io_wq->end_io; | 1746 | bio->bi_end_io = end_io_wq->end_io; |
1747 | kmem_cache_free(btrfs_end_io_wq_cache, end_io_wq); | 1747 | kmem_cache_free(btrfs_end_io_wq_cache, end_io_wq); |
1748 | bio_endio_nodec(bio, error); | 1748 | bio_endio(bio, error); |
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | static int cleaner_kthread(void *arg) | 1751 | static int cleaner_kthread(void *arg) |
@@ -3269,11 +3269,8 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3269 | */ | 3269 | */ |
3270 | static void btrfs_end_empty_barrier(struct bio *bio, int err) | 3270 | static void btrfs_end_empty_barrier(struct bio *bio, int err) |
3271 | { | 3271 | { |
3272 | if (err) { | 3272 | if (err) |
3273 | if (err == -EOPNOTSUPP) | ||
3274 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
3275 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | 3273 | clear_bit(BIO_UPTODATE, &bio->bi_flags); |
3276 | } | ||
3277 | if (bio->bi_private) | 3274 | if (bio->bi_private) |
3278 | complete(bio->bi_private); | 3275 | complete(bio->bi_private); |
3279 | bio_put(bio); | 3276 | bio_put(bio); |
@@ -3301,11 +3298,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait) | |||
3301 | 3298 | ||
3302 | wait_for_completion(&device->flush_wait); | 3299 | wait_for_completion(&device->flush_wait); |
3303 | 3300 | ||
3304 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) { | 3301 | if (!bio_flagged(bio, BIO_UPTODATE)) { |
3305 | printk_in_rcu("BTRFS: disabling barriers on dev %s\n", | ||
3306 | rcu_str_deref(device->name)); | ||
3307 | device->nobarriers = 1; | ||
3308 | } else if (!bio_flagged(bio, BIO_UPTODATE)) { | ||
3309 | ret = -EIO; | 3302 | ret = -EIO; |
3310 | btrfs_dev_stat_inc_and_print(device, | 3303 | btrfs_dev_stat_inc_and_print(device, |
3311 | BTRFS_DEV_STAT_FLUSH_ERRS); | 3304 | BTRFS_DEV_STAT_FLUSH_ERRS); |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c32d226bfecc..c374e1e71e5f 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2767,8 +2767,6 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, | |||
2767 | else | 2767 | else |
2768 | btrfsic_submit_bio(rw, bio); | 2768 | btrfsic_submit_bio(rw, bio); |
2769 | 2769 | ||
2770 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) | ||
2771 | ret = -EOPNOTSUPP; | ||
2772 | bio_put(bio); | 2770 | bio_put(bio); |
2773 | return ret; | 2771 | return ret; |
2774 | } | 2772 | } |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 174f5e1e00ab..53af23f2c087 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -345,7 +345,7 @@ loop_lock: | |||
345 | waitqueue_active(&fs_info->async_submit_wait)) | 345 | waitqueue_active(&fs_info->async_submit_wait)) |
346 | wake_up(&fs_info->async_submit_wait); | 346 | wake_up(&fs_info->async_submit_wait); |
347 | 347 | ||
348 | BUG_ON(atomic_read(&cur->bi_cnt) == 0); | 348 | BUG_ON(atomic_read(&cur->__bi_cnt) == 0); |
349 | 349 | ||
350 | /* | 350 | /* |
351 | * if we're doing the sync list, record that our | 351 | * if we're doing the sync list, record that our |
@@ -5586,10 +5586,10 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | |||
5586 | 5586 | ||
5587 | static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio, int err) | 5587 | static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio, int err) |
5588 | { | 5588 | { |
5589 | if (likely(bbio->flags & BTRFS_BIO_ORIG_BIO_SUBMITTED)) | 5589 | bio->bi_private = bbio->private; |
5590 | bio_endio_nodec(bio, err); | 5590 | bio->bi_end_io = bbio->end_io; |
5591 | else | 5591 | bio_endio(bio, err); |
5592 | bio_endio(bio, err); | 5592 | |
5593 | btrfs_put_bbio(bbio); | 5593 | btrfs_put_bbio(bbio); |
5594 | } | 5594 | } |
5595 | 5595 | ||
@@ -5633,8 +5633,6 @@ static void btrfs_end_bio(struct bio *bio, int err) | |||
5633 | bio = bbio->orig_bio; | 5633 | bio = bbio->orig_bio; |
5634 | } | 5634 | } |
5635 | 5635 | ||
5636 | bio->bi_private = bbio->private; | ||
5637 | bio->bi_end_io = bbio->end_io; | ||
5638 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; | 5636 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; |
5639 | /* only send an error to the higher layers if it is | 5637 | /* only send an error to the higher layers if it is |
5640 | * beyond the tolerance of the btrfs bio | 5638 | * beyond the tolerance of the btrfs bio |
@@ -5816,8 +5814,6 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) | |||
5816 | /* Shoud be the original bio. */ | 5814 | /* Shoud be the original bio. */ |
5817 | WARN_ON(bio != bbio->orig_bio); | 5815 | WARN_ON(bio != bbio->orig_bio); |
5818 | 5816 | ||
5819 | bio->bi_private = bbio->private; | ||
5820 | bio->bi_end_io = bbio->end_io; | ||
5821 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; | 5817 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; |
5822 | bio->bi_iter.bi_sector = logical >> 9; | 5818 | bio->bi_iter.bi_sector = logical >> 9; |
5823 | 5819 | ||
@@ -5898,10 +5894,8 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | |||
5898 | if (dev_nr < total_devs - 1) { | 5894 | if (dev_nr < total_devs - 1) { |
5899 | bio = btrfs_bio_clone(first_bio, GFP_NOFS); | 5895 | bio = btrfs_bio_clone(first_bio, GFP_NOFS); |
5900 | BUG_ON(!bio); /* -ENOMEM */ | 5896 | BUG_ON(!bio); /* -ENOMEM */ |
5901 | } else { | 5897 | } else |
5902 | bio = first_bio; | 5898 | bio = first_bio; |
5903 | bbio->flags |= BTRFS_BIO_ORIG_BIO_SUBMITTED; | ||
5904 | } | ||
5905 | 5899 | ||
5906 | submit_stripe_bio(root, bbio, bio, | 5900 | submit_stripe_bio(root, bbio, bio, |
5907 | bbio->stripes[dev_nr].physical, dev_nr, rw, | 5901 | bbio->stripes[dev_nr].physical, dev_nr, rw, |
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index ebc31331a837..cedae0356558 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -292,8 +292,6 @@ struct btrfs_bio_stripe { | |||
292 | struct btrfs_bio; | 292 | struct btrfs_bio; |
293 | typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); | 293 | typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); |
294 | 294 | ||
295 | #define BTRFS_BIO_ORIG_BIO_SUBMITTED (1 << 0) | ||
296 | |||
297 | struct btrfs_bio { | 295 | struct btrfs_bio { |
298 | atomic_t refs; | 296 | atomic_t refs; |
299 | atomic_t stripes_pending; | 297 | atomic_t stripes_pending; |
diff --git a/fs/buffer.c b/fs/buffer.c index c7a5602d01ee..f96173ad62d9 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2938,10 +2938,6 @@ static void end_bio_bh_io_sync(struct bio *bio, int err) | |||
2938 | { | 2938 | { |
2939 | struct buffer_head *bh = bio->bi_private; | 2939 | struct buffer_head *bh = bio->bi_private; |
2940 | 2940 | ||
2941 | if (err == -EOPNOTSUPP) { | ||
2942 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
2943 | } | ||
2944 | |||
2945 | if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags))) | 2941 | if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags))) |
2946 | set_bit(BH_Quiet, &bh->b_state); | 2942 | set_bit(BH_Quiet, &bh->b_state); |
2947 | 2943 | ||
@@ -3000,7 +2996,6 @@ void guard_bio_eod(int rw, struct bio *bio) | |||
3000 | int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) | 2996 | int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) |
3001 | { | 2997 | { |
3002 | struct bio *bio; | 2998 | struct bio *bio; |
3003 | int ret = 0; | ||
3004 | 2999 | ||
3005 | BUG_ON(!buffer_locked(bh)); | 3000 | BUG_ON(!buffer_locked(bh)); |
3006 | BUG_ON(!buffer_mapped(bh)); | 3001 | BUG_ON(!buffer_mapped(bh)); |
@@ -3041,14 +3036,8 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) | |||
3041 | if (buffer_prio(bh)) | 3036 | if (buffer_prio(bh)) |
3042 | rw |= REQ_PRIO; | 3037 | rw |= REQ_PRIO; |
3043 | 3038 | ||
3044 | bio_get(bio); | ||
3045 | submit_bio(rw, bio); | 3039 | submit_bio(rw, bio); |
3046 | 3040 | return 0; | |
3047 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) | ||
3048 | ret = -EOPNOTSUPP; | ||
3049 | |||
3050 | bio_put(bio); | ||
3051 | return ret; | ||
3052 | } | 3041 | } |
3053 | EXPORT_SYMBOL_GPL(_submit_bh); | 3042 | EXPORT_SYMBOL_GPL(_submit_bh); |
3054 | 3043 | ||
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 79636e21d3a2..5602450f03f6 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -359,7 +359,6 @@ void ext4_io_submit(struct ext4_io_submit *io) | |||
359 | if (bio) { | 359 | if (bio) { |
360 | bio_get(io->io_bio); | 360 | bio_get(io->io_bio); |
361 | submit_bio(io->io_op, io->io_bio); | 361 | submit_bio(io->io_op, io->io_bio); |
362 | BUG_ON(bio_flagged(io->io_bio, BIO_EOPNOTSUPP)); | ||
363 | bio_put(io->io_bio); | 362 | bio_put(io->io_bio); |
364 | } | 363 | } |
365 | io->io_bio = NULL; | 364 | io->io_bio = NULL; |
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index dc3a9efdaab8..42468e5ab3e7 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c | |||
@@ -343,11 +343,6 @@ static void nilfs_end_bio_write(struct bio *bio, int err) | |||
343 | const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 343 | const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
344 | struct nilfs_segment_buffer *segbuf = bio->bi_private; | 344 | struct nilfs_segment_buffer *segbuf = bio->bi_private; |
345 | 345 | ||
346 | if (err == -EOPNOTSUPP) { | ||
347 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
348 | /* to be detected by nilfs_segbuf_submit_bio() */ | ||
349 | } | ||
350 | |||
351 | if (!uptodate) | 346 | if (!uptodate) |
352 | atomic_inc(&segbuf->sb_err); | 347 | atomic_inc(&segbuf->sb_err); |
353 | 348 | ||
@@ -374,15 +369,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, | |||
374 | 369 | ||
375 | bio->bi_end_io = nilfs_end_bio_write; | 370 | bio->bi_end_io = nilfs_end_bio_write; |
376 | bio->bi_private = segbuf; | 371 | bio->bi_private = segbuf; |
377 | bio_get(bio); | ||
378 | submit_bio(mode, bio); | 372 | submit_bio(mode, bio); |
379 | segbuf->sb_nbio++; | 373 | segbuf->sb_nbio++; |
380 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) { | ||
381 | bio_put(bio); | ||
382 | err = -EOPNOTSUPP; | ||
383 | goto failed; | ||
384 | } | ||
385 | bio_put(bio); | ||
386 | 374 | ||
387 | wi->bio = NULL; | 375 | wi->bio = NULL; |
388 | wi->rest_blocks -= wi->end - wi->start; | 376 | wi->rest_blocks -= wi->end - wi->start; |
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index a56960dd1684..095f94c2d8b5 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c | |||
@@ -356,7 +356,6 @@ xfs_end_bio( | |||
356 | { | 356 | { |
357 | xfs_ioend_t *ioend = bio->bi_private; | 357 | xfs_ioend_t *ioend = bio->bi_private; |
358 | 358 | ||
359 | ASSERT(atomic_read(&bio->bi_cnt) >= 1); | ||
360 | ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error; | 359 | ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error; |
361 | 360 | ||
362 | /* Toss bio and pass work off to an xfsdatad thread */ | 361 | /* Toss bio and pass work off to an xfsdatad thread */ |