From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>,
linux-xfs@vger.kernel.org, ritesh.list@gmail.com,
ojaswin@linux.ibm.com, hch@infradead.org
Subject: Re: [PATCH v2 1/2] xfs: Move ASSERTion location in xfs_rtcopy_summary()
Date: Mon, 2 Feb 2026 10:53:48 -0800 [thread overview]
Message-ID: <20260202185348.GI7712@frogsfrogsfrogs> (raw)
In-Reply-To: <aYDWB22-IqrFhpYQ@nidhogg.toxiclabs.cc>
On Mon, Feb 02, 2026 at 05:51:39PM +0100, Carlos Maiolino wrote:
> > > > > > What am I missing here? This looks weird...
> > > > > > We execute the block if sum is lower than 0, and then we assert it's
> > > > > > greater or equal than zero? This looks the assert will never fire as it
> > > > > > will only be checked when sum is always negative.
> > > > > Ugh, nvm, I'll grab more coffee. On the other hand, this still looks
> > > > > confusing, it would be better if we just ASSERT(0) there.
> > > > Well, the idea (as discussed in [1] and [2]) was that we should log that sum
> > > > has been assigned an illegal negative value (using an ASSERT) and then bail
> > > > out.
> > > > [1] https://lore.kernel.org/all/20260122181148.GE5945@frogsfrogsfrogs/
> > > >
> > > > [2] https://lore.kernel.org/all/20260128161447.GV5945@frogsfrogsfrogs/
> > > I see. I honestly think this is really ugly, pointless, and confusing at
> > > a first glance (at least for me). The assert location is logged anyway
> > > when it fire.
> > >
> > > If I'm the only one who finds this confusing, then fine, otherwise I'd
> > > rather see ASSERT(0) in there.
> >
> > Sure, Carlos. ASSERT(0); sounds okay to me. Darrick, do you have any hard
> > preferences between ASSERT(0); and ASSERT(sum < 0); ? If not, then I can go
> > ahead, make the change and send a revision with the suggested change here.
Personally I think it's kinda dumb to log debugging messages that tell
you very little:
XFS: Assertion failed: 0, file: <whatever>
when you could actually say what the problem is:
XFS: Assertion failed: sum >= 0, file: <whatever>
but cem already said yes so I'm really just talking into the internet
here.
--D
>
> Thanks!
>
next prev parent reply other threads:[~2026-02-02 18:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 18:44 [PATCH v2 0/2] Misc fixes in XFS realtime Nirjhar Roy (IBM)
2026-01-28 18:44 ` [PATCH v2 1/2] xfs: Move ASSERTion location in xfs_rtcopy_summary() Nirjhar Roy (IBM)
2026-01-29 8:52 ` Carlos Maiolino
2026-01-29 8:57 ` Carlos Maiolino
2026-01-29 12:34 ` Nirjhar Roy (IBM)
2026-01-29 13:29 ` Carlos Maiolino
2026-01-29 17:10 ` Alan Huang
2026-02-02 14:08 ` Nirjhar Roy (IBM)
2026-02-02 16:51 ` Carlos Maiolino
2026-02-02 18:53 ` Darrick J. Wong [this message]
2026-01-28 18:44 ` [PATCH v2 2/2] xfs: Fix in xfs_rtalloc_query_range() Nirjhar Roy (IBM)
2026-01-29 9:03 ` Carlos Maiolino
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=20260202185348.GI7712@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nirjhar.roy.lists@gmail.com \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
/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