All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: hch@infradead.org, cem@kernel.org, linux-xfs@vger.kernel.org,
	ritesh.list@gmail.com, ojaswin@linux.ibm.com
Subject: Re: [patch v4 1/2] xfs: Replace ASSERT with XFS_IS_CORRUPT in xfs_rtcopy_summary()
Date: Fri, 6 Feb 2026 00:03:11 +0530	[thread overview]
Message-ID: <e2fb579c-d7cf-4075-9cc1-41cfa9bfb689@gmail.com> (raw)
In-Reply-To: <20260205162100.GO7712@frogsfrogsfrogs>


On 2/5/26 21:51, Darrick J. Wong wrote:
> On Wed, Feb 04, 2026 at 08:36:26PM +0530, Nirjhar Roy (IBM) wrote:
>> Replace ASSERT(sum > 0) with an XFS_IS_CORRUPT() and place it just
>> after the call to xfs_rtget_summary() so that we don't end up using
>> an illegal value of sum.
>>
>> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
> Looks good to me now, thanks for your persistence!
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

Thank you for your review comments.

--NR

>
> --D
>
>> ---
>>   fs/xfs/xfs_rtalloc.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
>> index a12ffed12391..3035e4a7e817 100644
>> --- a/fs/xfs/xfs_rtalloc.c
>> +++ b/fs/xfs/xfs_rtalloc.c
>> @@ -112,6 +112,10 @@ xfs_rtcopy_summary(
>>   			error = xfs_rtget_summary(oargs, log, bbno, &sum);
>>   			if (error)
>>   				goto out;
>> +			if (XFS_IS_CORRUPT(oargs->mp, sum < 0)) {
>> +				error = -EFSCORRUPTED;
>> +				goto out;
>> +			}
>>   			if (sum == 0)
>>   				continue;
>>   			error = xfs_rtmodify_summary(oargs, log, bbno, -sum);
>> @@ -120,7 +124,6 @@ xfs_rtcopy_summary(
>>   			error = xfs_rtmodify_summary(nargs, log, bbno, sum);
>>   			if (error)
>>   				goto out;
>> -			ASSERT(sum > 0);
>>   		}
>>   	}
>>   	error = 0;
>> -- 
>> 2.43.5
>>
>>
-- 
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore


  reply	other threads:[~2026-02-05 18:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 15:06 [patch v4 0/2] Misc fixes in XFS realtime Nirjhar Roy (IBM)
2026-02-04 15:06 ` [patch v4 1/2] xfs: Replace ASSERT with XFS_IS_CORRUPT in xfs_rtcopy_summary() Nirjhar Roy (IBM)
2026-02-05 16:21   ` Darrick J. Wong
2026-02-05 18:33     ` Nirjhar Roy (IBM) [this message]
2026-02-06 12:48   ` Carlos Maiolino
2026-02-06 12:51     ` Nirjhar Roy (IBM)
2026-02-04 15:06 ` [patch v4 2/2] xfs: Fix in xfs_rtalloc_query_range() Nirjhar Roy (IBM)
2026-02-25 10:40   ` Carlos Maiolino
2026-02-25 11:28     ` Nirjhar Roy (IBM)
2026-02-25 12:19       ` Carlos Maiolino
2026-02-25 14:46         ` Nirjhar Roy (IBM)
2026-02-16 16:42 ` [patch v4 0/2] Misc fixes in XFS realtime Carlos Maiolino
2026-02-16 16:43   ` Nirjhar Roy (IBM)

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=e2fb579c-d7cf-4075-9cc1-41cfa9bfb689@gmail.com \
    --to=nirjhar.roy.lists@gmail.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.