Skip to contentSkip to conversation

xfs: don't update lastino for FSBULKSTAT_SINGLE

PATCH In review Darrick J. Wong 3 participants 3 messages Jul 6, 2019 – Jul 8, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: don't update lastino for FSBULKSTAT_SINGLE

From: Darrick J. Wong <[email protected]>

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 2810bd6840e463 ("xfs: convert bulkstat to new iwalk infrastructure")
---
 fs/xfs/xfs_ioctl.c |    1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_ioctl.c +0 -1
index 6bf04e71325b..1876461e5104 100644
@@ -797,7 +797,6 @@ xfs_ioc_fsbulkstat(
 		breq.startino = lastino;
 		breq.icount = 1;
 		error = xfs_bulkstat_one(&breq, xfs_fsbulkstat_one_fmt);
-		lastino = breq.startino;
 	} else {	/* XFS_IOC_FSBULKSTAT */
 		breq.startino = lastino ? lastino + 1 : 0;
 		error = xfs_bulkstat(&breq, xfs_fsbulkstat_one_fmt);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

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.

Looks ok to me. Thanks!

Quoted 20 lines
Fixes 2810bd6840e463 ("xfs: convert bulkstat to new iwalk infrastructure")
---
  fs/xfs/xfs_ioctl.c |    1 -
  1 file changed, 1 deletion(-)
fs/xfs/xfs_ioctl.c +0 -1
index 6bf04e71325b..1876461e5104 100644
@@ -797,7 +797,6 @@ xfs_ioc_fsbulkstat(
  		breq.startino = lastino;
  		breq.icount = 1;
  		error = xfs_bulkstat_one(&breq, xfs_fsbulkstat_one_fmt);
-		lastino = breq.startino;
  	} else {	/* XFS_IOC_FSBULKSTAT */
  		breq.startino = lastino ? lastino + 1 : 0;
  		error = xfs_bulkstat(&breq, xfs_fsbulkstat_one_fmt);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 7 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

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.

Quoted 7 lines

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

Fixes 2810bd6840e463 ("xfs: convert bulkstat to new iwalk infrastructure")

---

Quoted 15 lines
 fs/xfs/xfs_ioctl.c |    1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_ioctl.c +0 -1
index 6bf04e71325b..1876461e5104 100644
@@ -797,7 +797,6 @@ xfs_ioc_fsbulkstat(
 		breq.startino = lastino;
 		breq.icount = 1;
 		error = xfs_bulkstat_one(&breq, xfs_fsbulkstat_one_fmt);
-		lastino = breq.startino;
 	} else {	/* XFS_IOC_FSBULKSTAT */
 		breq.startino = lastino ? lastino + 1 : 0;
 		error = xfs_bulkstat(&breq, xfs_fsbulkstat_one_fmt);