diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 10a2a579cc7f..a8ecccfc36de 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -3231,6 +3231,7 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3231 | int errors = 0; | 3231 | int errors = 0; |
3232 | u32 crc; | 3232 | u32 crc; |
3233 | u64 bytenr; | 3233 | u64 bytenr; |
3234 | int op_flags; | ||
3234 | 3235 | ||
3235 | if (max_mirrors == 0) | 3236 | if (max_mirrors == 0) |
3236 | max_mirrors = BTRFS_SUPER_MIRROR_MAX; | 3237 | max_mirrors = BTRFS_SUPER_MIRROR_MAX; |
@@ -3273,13 +3274,10 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3273 | * we fua the first super. The others we allow | 3274 | * we fua the first super. The others we allow |
3274 | * to go down lazy. | 3275 | * to go down lazy. |
3275 | */ | 3276 | */ |
3276 | if (i == 0) { | 3277 | op_flags = REQ_SYNC | REQ_META | REQ_PRIO; |
3277 | ret = btrfsic_submit_bh(REQ_OP_WRITE, | 3278 | if (i == 0 && !btrfs_test_opt(device->fs_info, NOBARRIER)) |
3278 | REQ_SYNC | REQ_FUA | REQ_META | REQ_PRIO, bh); | 3279 | op_flags |= REQ_FUA; |
3279 | } else { | 3280 | ret = btrfsic_submit_bh(REQ_OP_WRITE, op_flags, bh); |
3280 | ret = btrfsic_submit_bh(REQ_OP_WRITE, | ||
3281 | REQ_SYNC | REQ_META | REQ_PRIO, bh); | ||
3282 | } | ||
3283 | if (ret) | 3281 | if (ret) |
3284 | errors++; | 3282 | errors++; |
3285 | } | 3283 | } |