xfs: don't update lastino for FSBULKSTAT_SINGLE

The kernel test robot found a regression of xfs/054 in the conversion of
bulkstat to use the new iwalk infrastructure -- if a caller set *lastip
= 128 and invoked FSBULKSTAT_SINGLE, the bstat info would be for inode
128, but *lastip would be increased by the kernel to 129.

FSBULKSTAT_SINGLE never incremented lastip before, so it's incorrect to
make such an update to the internal lastino value now.

Fixes: 2810bd6840 ("xfs: convert bulkstat to new iwalk infrastructure")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
This commit is contained in:
Darrick J. Wong 2019-07-06 09:29:01 -07:00
parent 036f463fe1
commit 211bbf3c38
1 changed files with 0 additions and 1 deletions

View File

@ -797,7 +797,6 @@ xfs_ioc_fsbulkstat(
breq.startino = lastino; breq.startino = lastino;
breq.icount = 1; breq.icount = 1;
error = xfs_bulkstat_one(&breq, xfs_fsbulkstat_one_fmt); error = xfs_bulkstat_one(&breq, xfs_fsbulkstat_one_fmt);
lastino = breq.startino;
} else { /* XFS_IOC_FSBULKSTAT */ } else { /* XFS_IOC_FSBULKSTAT */
breq.startino = lastino ? lastino + 1 : 0; breq.startino = lastino ? lastino + 1 : 0;
error = xfs_bulkstat(&breq, xfs_fsbulkstat_one_fmt); error = xfs_bulkstat(&breq, xfs_fsbulkstat_one_fmt);