From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, rgoldwyn@suse.de, rgoldwyn@suse.com
Subject: Re: [PATCH 1/2] btrfs: Add WARN_ON for qgroup reserved underflow
Date: Thu, 20 Oct 2016 11:20:00 +0200 [thread overview]
Message-ID: <20161020092000.GW11398@suse.cz> (raw)
In-Reply-To: <0b4d5b87-4f47-3874-b1e3-a7e7e06f0c59@cn.fujitsu.com>
On Thu, Oct 20, 2016 at 09:05:34AM +0800, Qu Wenruo wrote:
>
>
> At 10/19/2016 10:31 PM, David Sterba wrote:
> > On Fri, Sep 30, 2016 at 09:15:36AM +0800, Qu Wenruo wrote:
> >> While the reason why qgroup reserved space may underflow is still under
> >> investigation, such WARN_ON will help us to expose the bug more easily,
> >> and for end-user we can detect and avoid underflow.
> >>
> >> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> >> ---
> >> fs/btrfs/qgroup.c | 21 ++++++++++++++++-----
> >> 1 file changed, 16 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> >> index 8db2e29..8532587 100644
> >> --- a/fs/btrfs/qgroup.c
> >> +++ b/fs/btrfs/qgroup.c
> >> @@ -1061,8 +1061,12 @@ static int __qgroup_excl_accounting(struct btrfs_fs_info *fs_info,
> >> WARN_ON(sign < 0 && qgroup->excl < num_bytes);
> >> qgroup->excl += sign * num_bytes;
> >> qgroup->excl_cmpr += sign * num_bytes;
> >> - if (sign > 0)
> >> - qgroup->reserved -= num_bytes;
> >> + if (sign > 0) {
> >> + if (WARN_ON(qgroup->reserved < num_bytes))
> >
> > That's only partially helpful, you should also print the numbers,
> > ref_root and/or qgroup id.
> >
>
> I'm OK to add more output.
> But normally it's not really help though.
So do you need the warning at all? The next patch adds tracepoints, I
assume you turn them on and look for the issues you're debugging. The
warning would otherwise appear for any user. Without the message it's
IME more scary, it's not obvious what happened without looking into the
code.
next prev parent reply other threads:[~2016-10-20 9:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 1:15 [PATCH 1/2] btrfs: Add WARN_ON for qgroup reserved underflow Qu Wenruo
2016-09-30 1:15 ` [PATCH 2/2] btrfs: Add trace point for qgroup reserved space Qu Wenruo
2016-09-30 15:44 ` Goldwyn Rodrigues
2016-09-30 15:43 ` [PATCH 1/2] btrfs: Add WARN_ON for qgroup reserved underflow Goldwyn Rodrigues
2016-10-19 14:31 ` David Sterba
2016-10-20 1:05 ` Qu Wenruo
2016-10-20 9:20 ` David Sterba [this message]
2016-10-20 9:41 ` Qu Wenruo
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=20161020092000.GW11398@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
--cc=rgoldwyn@suse.com \
--cc=rgoldwyn@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).