Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Boris Burkov <boris@bur.io>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Cc: marc@merlins.org
Subject: Re: [PATCH 4/4] btrfs: swallow btrfs_record_squota_delta() enoent
Date: Wed, 13 May 2026 10:24:23 +0930	[thread overview]
Message-ID: <fcdb6408-a551-4459-a0d6-199be5e523a3@gmx.com> (raw)
In-Reply-To: <2d814d975b4bb96a8310d9c941c5457e10db388a.1778613519.git.boris@bur.io>



在 2026/5/13 05:04, Boris Burkov 写道:
> I thought that it was likely I could harden squota deletion to the point
> that it was impossible to end up with an extent accounted to a qgroup
> outliving its qgroup. Several recent bugs have made me re-consider that
> position.
> 
> Ultimately, this is a tradeoff between short term stability and long
> term strictness, but I think given that there could be another layer of
> bugs behind the 2-3 I just fixed, I would feel much more confident in
> people using squotas if the risk was "your values can get a bit out of
> whack which you can fix by deleting stuff or
> disabling/re-enabling/repairing" vs "it will abort your filesystem".
> 
> As the final nail in the coffin, the Meta production kernel was lacking
> earlier fixes from me and Qu regarding subvol qgroup lifetime, so this
> is what we have been testing at scale, so I think at least for now
> upstream should have the same extra layer of protection.
> 
> Signed-off-by: Boris Burkov <boris@bur.io>
> ---
>   fs/btrfs/qgroup.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index a93d49015fc7..f9e5005028dc 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -4959,7 +4959,7 @@ int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
>   	spin_lock(&fs_info->qgroup_lock);
>   	qgroup = find_qgroup_rb(fs_info, root);
>   	if (!qgroup) {
> -		ret = -ENOENT;
> +		ret = 0;

I appreciate that end users won't be bothered with transaction abort, 
but on the other hand, this seems to mask real bugs.

Can we add a WARN_ON_ONCE(IS_ENABLED(CONFIG_BTRFS_DEBUG))) so that we 
can catch such problems for debug builds?

Thanks,
Qu>   		goto out;
>   	}
>   


  reply	other threads:[~2026-05-13  0:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 19:34 [PATCH 0/4] btrfs: squota lifetime fixes Boris Burkov
2026-05-12 19:34 ` [PATCH 1/4] btrfs: check for subvolume before deleting squota qgroup Boris Burkov
2026-05-12 19:34 ` [PATCH 2/4] btrfs: fix squota accounting during enable generation Boris Burkov
2026-05-12 19:34 ` [PATCH 3/4] btrfs: clamp to avoid squota underflow Boris Burkov
2026-05-13  0:53   ` Qu Wenruo
2026-05-12 19:34 ` [PATCH 4/4] btrfs: swallow btrfs_record_squota_delta() enoent Boris Burkov
2026-05-13  0:54   ` Qu Wenruo [this message]
2026-05-13  1:01 ` [PATCH 0/4] btrfs: squota lifetime fixes Qu Wenruo
2026-05-13  2:13 ` David Sterba

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=fcdb6408-a551-4459-a0d6-199be5e523a3@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=boris@bur.io \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=marc@merlins.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