diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 053109ba26b7..cc15514b4a76 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1724,6 +1724,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | |||
1724 | bdi->ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE; | 1724 | bdi->ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE; |
1725 | bdi->congested_fn = btrfs_congested_fn; | 1725 | bdi->congested_fn = btrfs_congested_fn; |
1726 | bdi->congested_data = info; | 1726 | bdi->congested_data = info; |
1727 | bdi->capabilities |= BDI_CAP_CGROUP_WRITEBACK; | ||
1727 | return 0; | 1728 | return 0; |
1728 | } | 1729 | } |
1729 | 1730 | ||
@@ -1744,7 +1745,7 @@ static void end_workqueue_fn(struct btrfs_work *work) | |||
1744 | bio->bi_private = end_io_wq->private; | 1745 | bio->bi_private = end_io_wq->private; |
1745 | bio->bi_end_io = end_io_wq->end_io; | 1746 | bio->bi_end_io = end_io_wq->end_io; |
1746 | kmem_cache_free(btrfs_end_io_wq_cache, end_io_wq); | 1747 | kmem_cache_free(btrfs_end_io_wq_cache, end_io_wq); |
1747 | bio_endio_nodec(bio, error); | 1748 | bio_endio(bio, error); |
1748 | } | 1749 | } |
1749 | 1750 | ||
1750 | static int cleaner_kthread(void *arg) | 1751 | static int cleaner_kthread(void *arg) |
@@ -2608,7 +2609,6 @@ int open_ctree(struct super_block *sb, | |||
2608 | 2609 | ||
2609 | 2610 | ||
2610 | mutex_init(&fs_info->ordered_operations_mutex); | 2611 | mutex_init(&fs_info->ordered_operations_mutex); |
2611 | mutex_init(&fs_info->ordered_extent_flush_mutex); | ||
2612 | mutex_init(&fs_info->tree_log_mutex); | 2612 | mutex_init(&fs_info->tree_log_mutex); |
2613 | mutex_init(&fs_info->chunk_mutex); | 2613 | mutex_init(&fs_info->chunk_mutex); |
2614 | mutex_init(&fs_info->transaction_kthread_mutex); | 2614 | mutex_init(&fs_info->transaction_kthread_mutex); |
@@ -2950,8 +2950,9 @@ retry_root_backup: | |||
2950 | if (fs_info->fs_devices->missing_devices > | 2950 | if (fs_info->fs_devices->missing_devices > |
2951 | fs_info->num_tolerated_disk_barrier_failures && | 2951 | fs_info->num_tolerated_disk_barrier_failures && |
2952 | !(sb->s_flags & MS_RDONLY)) { | 2952 | !(sb->s_flags & MS_RDONLY)) { |
2953 | printk(KERN_WARNING "BTRFS: " | 2953 | pr_warn("BTRFS: missing devices(%llu) exceeds the limit(%d), writeable mount is not allowed\n", |
2954 | "too many missing devices, writeable mount is not allowed\n"); | 2954 | fs_info->fs_devices->missing_devices, |
2955 | fs_info->num_tolerated_disk_barrier_failures); | ||
2955 | goto fail_sysfs; | 2956 | goto fail_sysfs; |
2956 | } | 2957 | } |
2957 | 2958 | ||
@@ -3326,11 +3327,8 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3326 | */ | 3327 | */ |
3327 | static void btrfs_end_empty_barrier(struct bio *bio, int err) | 3328 | static void btrfs_end_empty_barrier(struct bio *bio, int err) |
3328 | { | 3329 | { |
3329 | if (err) { | 3330 | if (err) |
3330 | if (err == -EOPNOTSUPP) | ||
3331 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
3332 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | 3331 | clear_bit(BIO_UPTODATE, &bio->bi_flags); |
3333 | } | ||
3334 | if (bio->bi_private) | 3332 | if (bio->bi_private) |
3335 | complete(bio->bi_private); | 3333 | complete(bio->bi_private); |
3336 | bio_put(bio); | 3334 | bio_put(bio); |
@@ -3358,11 +3356,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait) | |||
3358 | 3356 | ||
3359 | wait_for_completion(&device->flush_wait); | 3357 | wait_for_completion(&device->flush_wait); |
3360 | 3358 | ||
3361 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) { | 3359 | if (!bio_flagged(bio, BIO_UPTODATE)) { |
3362 | printk_in_rcu("BTRFS: disabling barriers on dev %s\n", | ||
3363 | rcu_str_deref(device->name)); | ||
3364 | device->nobarriers = 1; | ||
3365 | } else if (!bio_flagged(bio, BIO_UPTODATE)) { | ||
3366 | ret = -EIO; | 3360 | ret = -EIO; |
3367 | btrfs_dev_stat_inc_and_print(device, | 3361 | btrfs_dev_stat_inc_and_print(device, |
3368 | BTRFS_DEV_STAT_FLUSH_ERRS); | 3362 | BTRFS_DEV_STAT_FLUSH_ERRS); |