Darrick J. Wong 9ab72f2227 xfs: fix off-by-one error when the last rt extent is in use
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.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
2021-08-18 18:46:00 -07:00
..
2021-01-24 14:43:46 +01:00
2021-01-24 14:27:20 +01:00
2021-08-18 18:45:59 -07:00
2021-06-21 10:05:51 -07:00
2021-07-02 14:30:27 -07:00
2021-08-09 15:57:43 -07:00
2021-08-09 15:57:43 -07:00
2021-04-15 09:35:51 -07:00
2021-07-02 14:30:27 -07:00
2021-04-12 15:04:29 +02:00
2021-04-12 15:04:29 +02:00
2021-04-12 15:04:29 +02:00
2021-01-24 14:43:46 +01:00
2021-01-24 14:43:46 +01:00
2021-06-21 10:05:51 -07:00
2021-06-21 10:05:46 -07:00
2021-06-02 10:48:24 +10:00
2021-01-24 14:43:46 +01:00
2021-08-16 12:09:27 -07:00