Nothing announced that stripe-exclusive allocation was on. The
btrfs.stripe_alloc property applies when btrfs_fill_super() reads the
root directory's inode and its properties, and btrfs_enable_stripe_alloc()
prints its line only for a set on a live filesystem, so mounting a
filesystem whose property was already set said nothing.
An absent line therefore meant "off" and "on" equally well, and the only
way to answer the question was to look at a live filesystem -- no use
when the filesystem is someone else's, or when all that is left is a log
from before a crash. Analysing a lockup from a filesystem whose
btrfs.stripe_alloc property was set, I read that silence as the policy
being off and said so, which was wrong.
State it once in btrfs_fill_super(), after the root inode has been read
so the property has had its say. The property path keeps its own line
for a set on a live filesystem, where there is no mount to report. At
mount that line still comes too, so a mount with the property set logs
the state twice, until "btrfs: stripe_alloc: say at mount whether the
policy is on (debug part)" later in this series quiets it there: it
needs the runtime enable worker of the write-hole checker.
Nothing is printed when the policy is off, which keeps the common mount
quiet and makes the absence of the line mean exactly one thing.
Assisted-by: Claude:claude-fable-5-1
Assisted-by: Claude:claude-opus-5-5
return 0;
}
+/*
+ * Log once at mount whether stripe-exclusive allocation is on: the property
+ * is applied silently while the root directory's inode is read.
+ */
+static void btrfs_emit_stripe_alloc_state(struct btrfs_fs_info *info)
+{
+ if (!btrfs_test_opt(info, STRIPE_ALLOC))
+ return;
+ btrfs_info(info,
+ "using stripe-exclusive allocation for raid56 data (filesystem property)");
+}
+
static int btrfs_fill_super(struct super_block *sb,
struct btrfs_fs_devices *fs_devices)
{
goto fail_close;
}
+ btrfs_emit_stripe_alloc_state(fs_info);
+
sb->s_root = d_make_root(&inode->vfs_inode);
if (!sb->s_root) {
ret = -ENOMEM;