Thread (13 messages) 13 messages, 3 authors, 2021-08-13

Re: [PATCH 2/3] xfs: fix off-by-one error when the last rt extent is in use

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-08-12 08:38:15

On Wed, Aug 11, 2021 at 05:58:47PM -0700, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@kernel.org>

The fsmap implementation for realtime devices uses the gap between
info->next_daddr and a free rtextent reported by xfs_rtalloc_query_range
to feed userspace fsmap records with an "unknown" owner.  We use this
trick to report to userspace when the last rtextent in the filesystem is
in use by synthesizing a null rmap record starting at the next block
after the query range.

Unfortunately, there's a minor accounting bug in the way that we
construct the null rmap record.  Originally, ahigh.ar_startext contains
the last rtextent for which the user wants records.  It's entirely
possible that number is beyond the end of the rt volume, so the location
synthesized rmap record /must/ be constrained to the minimum of the high
key and the number of extents in the rt volume.
Looks good, although the change is a little hard to follow due to the
big amount of cleanups vs the tiny actual bug fix.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help