summaryrefslogtreecommitdiff
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@kernel.org>2023-06-04 15:50:38 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-06-04 15:50:38 +0300
commit899e373ef0b0d3f1c2712a849f019de4f46bfa02 (patch)
treef823db81e141a59085ace0e7268fb89895afa3c2 /fs/btrfs/scrub.c
parent81f3affa19d6ab0c32aef46b053838219eef7e71 (diff)
parent7877cb91f1081754a1487c144d85dc0d2e2e7fc4 (diff)
downloadlinux-899e373ef0b0d3f1c2712a849f019de4f46bfa02.tar.xz
Merge tag 'v6.4-rc4' into v4l_for_linus
Linux 6.4-rc4 * tag 'v6.4-rc4': (606 commits) Linux 6.4-rc4 cxl: Explicitly initialize resources when media is not ready x86: re-introduce support for ERMS copies for user space accesses NVMe: Add MAXIO 1602 to bogus nid list. module: error out early on concurrent load of the same module file x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms cpufreq: amd-pstate: Update policy->cur in amd_pstate_adjust_perf() io_uring: unlock sqd->lock before sq thread release CPU MAINTAINERS: update arm64 Microchip entries udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). net: phy: mscc: enable VSC8501/2 RGMII RX clock net: phy: mscc: remove unnecessary phydev locking net: phy: mscc: add support for VSC8501 net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE net/handshake: Enable the SNI extension to work properly net/handshake: Unpin sock->file if a handshake is cancelled net/handshake: handshake_genl_notify() shouldn't ignore @flags net/handshake: Fix uninitialized local variable net/handshake: Fix handshake_dup() ref counting net/handshake: Remove unneeded check from handshake_dup() ...
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 836725a19661..dd37cba58022 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2518,13 +2518,20 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
if (ret == 0) {
ro_set = 1;
- } else if (ret == -ENOSPC && !sctx->is_dev_replace) {
+ } else if (ret == -ENOSPC && !sctx->is_dev_replace &&
+ !(cache->flags & BTRFS_BLOCK_GROUP_RAID56_MASK)) {
/*
* btrfs_inc_block_group_ro return -ENOSPC when it
* failed in creating new chunk for metadata.
* It is not a problem for scrub, because
* metadata are always cowed, and our scrub paused
* commit_transactions.
+ *
+ * For RAID56 chunks, we have to mark them read-only
+ * for scrub, as later we would use our own cache
+ * out of RAID56 realm.
+ * Thus we want the RAID56 bg to be marked RO to
+ * prevent RMW from screwing up out cache.
*/
ro_set = 0;
} else if (ret == -ETXTBSY) {