]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: support xrep_require_rtext_inuse on zoned file systems
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Jul 2024 13:31:28 +0000 (06:31 -0700)
committerChristoph Hellwig <hch@lst.de>
Mon, 3 Feb 2025 04:49:13 +0000 (05:49 +0100)
Space usage is tracked by the rmap, which already is separately
cross-referenced.  But on top of that we have the write pointer and can
do a basic sanity check here that the block is not beyond the write
pointer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fs/xfs/scrub/repair.c

index 5cdaf82aee7b6e8a5394d77867d7fbbdd24fd647..8e4d60567a21d296d146e37bceb2a8761a00f1ba 100644 (file)
@@ -43,6 +43,7 @@
 #include "xfs_rtalloc.h"
 #include "xfs_metafile.h"
 #include "xfs_rtrefcount_btree.h"
+#include "xfs_zone_alloc.h"
 #include "scrub/scrub.h"
 #include "scrub/common.h"
 #include "scrub/trace.h"
@@ -1050,7 +1051,13 @@ xrep_require_rtext_inuse(
        xfs_rtxnum_t            startrtx;
        xfs_rtxnum_t            endrtx;
        bool                    is_free = false;
-       int                     error;
+       int                     error = 0;
+
+       if (xfs_has_zoned(mp)) {
+               if (!xfs_zone_rgbno_is_valid(sc->sr.rtg, rgbno + len - 1))
+                       return -EFSCORRUPTED;
+               return 0;
+       }
 
        startrtx = xfs_rgbno_to_rtx(mp, rgbno);
        endrtx = xfs_rgbno_to_rtx(mp, rgbno + len - 1);