]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: handle totally empty inode chunks
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
We try to load a single inobt record with each FSINUMBERS call.  If the
chunk is totally empty (which can happen when there are more than one
inobt record per block) we should skip to the next INUMBERS call since
there are no inodes to bulkstat.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/inodes.c

index 693f21ec01ad2931a746d1cf5c1e8b83b93d4d16..442a597878f5402ef415480948a9103962a979c7 100644 (file)
@@ -139,6 +139,12 @@ xfs_iterate_inodes_range(
                /* Load the inodes. */
                ino = inogrp.xi_startino - 1;
                bulkreq.icount = inogrp.xi_alloccount;
+               /*
+                * We can have totally empty inode chunks on filesystems where
+                * there are more than 64 inodes per block.  Skip these.
+                */
+               if (inogrp.xi_alloccount == 0)
+                       goto igrp_retry;
                error = ioctl(ctx->mnt_fd, XFS_IOC_FSBULKSTAT, &bulkreq);
                if (error)
                        str_info(ctx, descr, "%s", strerror_r(errno,