Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a7e2695 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: fix a few erroneous process_error calls in the scrubbers



There are a few places where we make a libxfs api call on behalf of some
object other than the one we're scrubbing but inadvertently call the
regular process_error function.  When this happens we mark the object
corrupt even though it was corruption in /some other/ object that
actually produced the -EFSCORRUPTED code.  The correct output flag for
these situations is SCRUB_OFLAG_XFAIL, not SCRUB_OFLAG_CORRUPT, so fix
this now that we also have a helper to set these.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 64b12563
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,7 @@ xfs_scrub_dir_check_ftype(
	 * inodes can trigger immediate inactive cleanup of the inode.
	 * inodes can trigger immediate inactive cleanup of the inode.
	 */
	 */
	error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip);
	error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip);
	if (!xfs_scrub_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset,
	if (!xfs_scrub_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
			&error))
			&error))
		goto out;
		goto out;


+1 −1
Original line number Original line Diff line number Diff line
@@ -619,7 +619,7 @@ xfs_scrub_inode(
	if (xfs_is_reflink_inode(sc->ip)) {
	if (xfs_is_reflink_inode(sc->ip)) {
		error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
		error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
				&has_shared);
				&has_shared);
		if (!xfs_scrub_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
		if (!xfs_scrub_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
				XFS_INO_TO_AGBNO(mp, ino), &error))
				XFS_INO_TO_AGBNO(mp, ino), &error))
			goto out;
			goto out;
		if (!has_shared)
		if (!has_shared)
+3 −3
Original line number Original line Diff line number Diff line
@@ -169,7 +169,7 @@ xfs_scrub_parent_validate(
	 * immediate inactive cleanup of the inode.
	 * immediate inactive cleanup of the inode.
	 */
	 */
	error = xfs_iget(mp, sc->tp, dnum, 0, 0, &dp);
	error = xfs_iget(mp, sc->tp, dnum, 0, 0, &dp);
	if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
	if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
		goto out;
		goto out;
	if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
	if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
		xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
		xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
@@ -185,7 +185,7 @@ xfs_scrub_parent_validate(
	 */
	 */
	if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
	if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
		error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
		error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
		if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0,
		if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
				&error))
				&error))
			goto out_unlock;
			goto out_unlock;
		if (nlink != expected_nlink)
		if (nlink != expected_nlink)
@@ -205,7 +205,7 @@ xfs_scrub_parent_validate(


	/* Go looking for our dentry. */
	/* Go looking for our dentry. */
	error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
	error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
	if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
	if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
		goto out_unlock;
		goto out_unlock;


	/* Drop the parent lock, relock this inode. */
	/* Drop the parent lock, relock this inode. */