return false;
}
+/*
+ * Count and audit a metadata or system read-modify-write
+ * (audit_uncovered_rmw()), and warn if it lands in a raid56 group that
+ * stripe_meta does not cover. Silent when stripe_alloc is off.
+ */
+static void report_uncovered_rmw(struct btrfs_raid_bio *rbio)
+{
+ struct btrfs_fs_info *fs_info = rbio->bioc->fs_info;
+
+ if (!btrfs_test_opt(fs_info, STRIPE_ALLOC))
+ return;
+ /* Data groups are btrfs_is_stripe_alloc_bg()'s. */
+ if ((rbio->bioc->map_type & BTRFS_BLOCK_GROUP_DATA) &&
+ !(rbio->bioc->map_type & BTRFS_BLOCK_GROUP_METADATA))
+ return;
+
+ btrfs_warn_rl(fs_info,
+"read-modify-write of full stripe %llu: this block group is not covered by stripe_alloc, the raid56 write hole applies to it",
+ rbio->bioc->full_stripe_logical);
+}
+
static void rmw_rbio(struct btrfs_raid_bio *rbio)
{
struct bio_list bio_list;
goto out;
}
+ /* Still a sub-stripe write: this stripe is being modified in place. */
+ if (!rbio_is_full(rbio) && !test_bit(RBIO_PADDED_BIT, &rbio->flags))
+ report_uncovered_rmw(rbio);
+
/*
* At this stage we're not allowed to add any new bios to the
* bio list any more, anyone else that wants to change this stripe