* [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile
@ 2026-02-18 12:03 Mark Harmstone
2026-02-18 12:25 ` Filipe Manana
2026-02-18 21:24 ` Qu Wenruo
0 siblings, 2 replies; 3+ messages in thread
From: Mark Harmstone @ 2026-02-18 12:03 UTC (permalink / raw)
To: linux-btrfs, kevinhu; +Cc: Mark Harmstone
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")
Signed-off-by: Mark Harmstone <mark@harmstone.com>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4523b689711d..233d91556fe4 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4804,7 +4804,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;
}
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile
2026-02-18 12:03 [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile Mark Harmstone
@ 2026-02-18 12:25 ` Filipe Manana
2026-02-18 21:24 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Filipe Manana @ 2026-02-18 12:25 UTC (permalink / raw)
To: Mark Harmstone; +Cc: linux-btrfs, kevinhu
On Wed, Feb 18, 2026 at 12:03 PM Mark Harmstone <mark@harmstone.com> wrote:
>
> 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")
> Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Looks good, thanks.
> ---
> fs/btrfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 4523b689711d..233d91556fe4 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -4804,7 +4804,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;
> }
> --
> 2.52.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile
2026-02-18 12:03 [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile Mark Harmstone
2026-02-18 12:25 ` Filipe Manana
@ 2026-02-18 21:24 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-02-18 21:24 UTC (permalink / raw)
To: Mark Harmstone, linux-btrfs, kevinhu
在 2026/2/18 22:33, Mark Harmstone 写道:
> 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")
> Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 4523b689711d..233d91556fe4 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -4804,7 +4804,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;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-18 21:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 12:03 [PATCH] btrfs: print correct subvol num if can't delete because of active swapfile Mark Harmstone
2026-02-18 12:25 ` Filipe Manana
2026-02-18 21:24 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox