diff options
-rw-r--r-- | fs/gfs2/log.c | 19 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 5 |
2 files changed, 7 insertions, 17 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index cde1248a6225..9c65170e932e 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -592,22 +592,13 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull) | |||
592 | lh->lh_hash = cpu_to_be32(hash); | 592 | lh->lh_hash = cpu_to_be32(hash); |
593 | 593 | ||
594 | bh->b_end_io = end_buffer_write_sync; | 594 | bh->b_end_io = end_buffer_write_sync; |
595 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) | ||
596 | goto skip_barrier; | ||
597 | get_bh(bh); | 595 | get_bh(bh); |
598 | submit_bh(WRITE_BARRIER | REQ_META, bh); | 596 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) |
599 | wait_on_buffer(bh); | ||
600 | if (buffer_eopnotsupp(bh)) { | ||
601 | clear_buffer_eopnotsupp(bh); | ||
602 | set_buffer_uptodate(bh); | ||
603 | fs_info(sdp, "barrier sync failed - disabling barriers\n"); | ||
604 | set_bit(SDF_NOBARRIERS, &sdp->sd_flags); | ||
605 | lock_buffer(bh); | ||
606 | skip_barrier: | ||
607 | get_bh(bh); | ||
608 | submit_bh(WRITE_SYNC | REQ_META, bh); | 597 | submit_bh(WRITE_SYNC | REQ_META, bh); |
609 | wait_on_buffer(bh); | 598 | else |
610 | } | 599 | submit_bh(WRITE_FLUSH_FUA | REQ_META, bh); |
600 | wait_on_buffer(bh); | ||
601 | |||
611 | if (!buffer_uptodate(bh)) | 602 | if (!buffer_uptodate(bh)) |
612 | gfs2_io_error_bh(sdp, bh); | 603 | gfs2_io_error_bh(sdp, bh); |
613 | brelse(bh); | 604 | brelse(bh); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 171a744f8e45..379316472918 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -854,8 +854,7 @@ static void gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset, | |||
854 | if ((start + nr_sects) != blk) { | 854 | if ((start + nr_sects) != blk) { |
855 | rv = blkdev_issue_discard(bdev, start, | 855 | rv = blkdev_issue_discard(bdev, start, |
856 | nr_sects, GFP_NOFS, | 856 | nr_sects, GFP_NOFS, |
857 | BLKDEV_IFL_WAIT | | 857 | BLKDEV_IFL_WAIT); |
858 | BLKDEV_IFL_BARRIER); | ||
859 | if (rv) | 858 | if (rv) |
860 | goto fail; | 859 | goto fail; |
861 | nr_sects = 0; | 860 | nr_sects = 0; |
@@ -870,7 +869,7 @@ start_new_extent: | |||
870 | } | 869 | } |
871 | if (nr_sects) { | 870 | if (nr_sects) { |
872 | rv = blkdev_issue_discard(bdev, start, nr_sects, GFP_NOFS, | 871 | rv = blkdev_issue_discard(bdev, start, nr_sects, GFP_NOFS, |
873 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | 872 | BLKDEV_IFL_WAIT); |
874 | if (rv) | 873 | if (rv) |
875 | goto fail; | 874 | goto fail; |
876 | } | 875 | } |