Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: cannot read default subvolume id?
Date: Mon, 28 Jul 2025 20:14:14 +0930	[thread overview]
Message-ID: <2099a2c0-2977-4ecb-8276-a878fe17ab24@suse.com> (raw)
In-Reply-To: <20250728100845.GE842273@tik.uni-stuttgart.de>



在 2025/7/28 19:38, Ulli Horlacher 写道:
> On Mon 2025-07-28 (08:06), Qu Wenruo wrote:
>>
>>
>> 圚 2025/7/28 03:16, Ulli Horlacher 写é":
>>
>>>
>>> Why is there a "cannot read default subvolume id"?
>>>
>>> tux@quak:~: btrfs sub create xx
>>> Create subvolume './xx'
>>>
>>> tux@quak:~: btrfs sub del xx
>>> WARNING: cannot read default subvolume id: Operation not permitted
>>
>> It's a warning, not an error. And you can see on the next line, the
>> deletion happened without any problem.
> 
> But this warning confuses a user:
> Is there a problem?
> What is going wrong?
> Have I made a mistake?

Yes, that's indeed confusing, and it should be hidden by commit 
0e66228959c4 ("btrfs-progs: subvol delete: hide a warning on an 
unprivileged delete"), which is included in v5.16.

Unfortunately that fix has a bug that the uid check is completely 
opposite...
> 
>> You're running as a non-root user, meanwhile default subvolume id search
>> is done using tree search ioctl, which require root privilege.
> 
> Why is this subvolume id search necessary for subvolume deletion and why
> is it just a warning and apparently no problem at all?
> If it does not have any consequences, it should not be displayed.
> 

It is an extra check to output a more meaningful error message if the 
end user is trying to delete the default subvolume.

Thus we need to search if the current subvolume is a default one.

Thanks,
Qu

      reply	other threads:[~2025-07-28 10:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-27 17:46 cannot read default subvolume id? Ulli Horlacher
2025-07-27 22:36 ` Qu Wenruo
2025-07-28 10:08   ` Ulli Horlacher
2025-07-28 10:44     ` Qu Wenruo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2099a2c0-2977-4ecb-8276-a878fe17ab24@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox