From: Chandan Babu R <chandan.babu@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, Christoph Hellwig <hch@lst.de>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/4] xfs_repair: fix sizing of the incore rt space usage map calculation
Date: Mon, 16 May 2022 14:33:47 +0530 [thread overview]
Message-ID: <875ym5spw3.fsf@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <165247403922.275439.1751140257416635238.stgit@magnolia>
On Fri, May 13, 2022 at 01:33:59 PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> If someone creates a realtime volume exactly *one* extent in length, the
> sizing calculation for the incore rt space usage bitmap will be zero
> because the integer division here rounds down. Use howmany() to round
> up. Note that there can't be that many single-extent rt volumes since
> repair will corrupt them into zero-extent rt volumes, and we haven't
> gotten any reports.
>
> Found by running xfs/530 after fixing xfs_repair to check the rt bitmap.
>
Looks good.
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
> repair/incore.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> diff --git a/repair/incore.c b/repair/incore.c
> index 4ffe18ab..10a8c2a8 100644
> --- a/repair/incore.c
> +++ b/repair/incore.c
> @@ -209,7 +209,7 @@ init_rt_bmap(
> if (mp->m_sb.sb_rextents == 0)
> return;
>
> - rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB),
> + rt_bmap_size = roundup(howmany(mp->m_sb.sb_rextents, (NBBY / XR_BB)),
> sizeof(uint64_t));
>
> rt_bmap = memalign(sizeof(uint64_t), rt_bmap_size);
--
chandan
next prev parent reply other threads:[~2022-05-16 11:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 20:33 [PATCHSET v2 0/4] xfs_repair: check rt bitmap and summary Darrick J. Wong
2022-05-13 20:33 ` [PATCH 1/4] xfs_repair: fix sizing of the incore rt space usage map calculation Darrick J. Wong
2022-05-16 9:03 ` Chandan Babu R [this message]
2022-05-13 20:34 ` [PATCH 2/4] xfs_repair: check free rt extent count Darrick J. Wong
2022-05-16 9:43 ` Chandan Babu R
2022-05-16 13:44 ` Christoph Hellwig
2022-05-13 20:34 ` [PATCH 3/4] xfs_repair: check the rt bitmap against observations Darrick J. Wong
2022-05-16 10:50 ` Chandan Babu R
2022-05-13 20:34 ` [PATCH 4/4] xfs_repair: check the rt summary " Darrick J. Wong
2022-05-16 11:00 ` Chandan Babu R
-- strict thread matches above, loose matches on Subject: below --
2022-05-05 16:04 [PATCHSET 0/4] xfs_repair: check rt bitmap and summary Darrick J. Wong
2022-05-05 16:04 ` [PATCH 1/4] xfs_repair: fix sizing of the incore rt space usage map calculation Darrick J. Wong
2022-05-10 12:51 ` Christoph Hellwig
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=875ym5spw3.fsf@debian-BULLSEYE-live-builder-AMD64 \
--to=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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