]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: print correct subvol num if active swapfile prevents deletion
authorMark Harmstone <mark@harmstone.com>
Tue, 17 Feb 2026 17:32:39 +0000 (17:32 +0000)
committerDavid Sterba <dsterba@suse.com>
Thu, 26 Feb 2026 14:03:28 +0000 (15:03 +0100)
Fix the error message in btrfs_delete_subvolume() if we can't delete a
subvolume because it has an active swapfile: we were printing the number
of the parent rather than the target.

Fixes: 60021bd754c6 ("btrfs: prevent subvol with swapfile from being deleted")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index ade5907077938b4dcc47a429f5cf0140fa9a0ee1..d28d55beaacd7e0ac7c6bf959015cb03b33f8178 100644 (file)
@@ -4779,7 +4779,7 @@ int btrfs_delete_subvolume(struct btrfs_inode *dir, struct dentry *dentry)
                spin_unlock(&dest->root_item_lock);
                btrfs_warn(fs_info,
                           "attempt to delete subvolume %llu with active swapfile",
-                          btrfs_root_id(root));
+                          btrfs_root_id(dest));
                ret = -EPERM;
                goto out_up_write;
        }