If bulkstat doesn't return an error code or any bulkstat records, we've
hit the end of the filesystem, so return early. This can happen if the
inumbers data came from the very last inobt record in the filesystem and
every inode in that inobt record is freed immediately after INUMBERS.
There's no bug here, it's just a minor optimization.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
/* First we try regular bulkstat, for speed. */
breq->hdr.ino = inumbers->xi_startino;
- xfrog_bulkstat(&ctx->mnt, breq);
+ error = -xfrog_bulkstat(&ctx->mnt, breq);
+ if (!error && !breq->hdr.ocount)
+ return;
/*
* Bulkstat might return inodes beyond xi_startino + CHUNKSIZE. Reduce