提交 3d8426b1 编写于 作者: D Darrick J. Wong

Merge tag 'scrub-fix-return-value-6.2_2022-11-16' of...

Merge tag 'scrub-fix-return-value-6.2_2022-11-16' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.2-mergeA

xfs: fix incorrect return values in online fsck

Here we fix a couple of problems with the errno values that we return to
userspace.

v23.2: fix vague wording of comment
v23.3: fix the commit message to discuss what's really going on in this
patch
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>

* tag 'scrub-fix-return-value-6.2_2022-11-16' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: don't return -EFSCORRUPTED from repair when resources cannot be grabbed
  xfs: don't retry repairs harder when EAGAIN is returned
  xfs: fix return code when fatal signal encountered during dquot scrub
  xfs: return EINTR when a fatal signal terminates scrub
...@@ -25,7 +25,7 @@ xchk_should_terminate( ...@@ -25,7 +25,7 @@ xchk_should_terminate(
if (fatal_signal_pending(current)) { if (fatal_signal_pending(current)) {
if (*error == 0) if (*error == 0)
*error = -EAGAIN; *error = -EINTR;
return true; return true;
} }
return false; return false;
......
...@@ -84,7 +84,7 @@ xchk_quota_item( ...@@ -84,7 +84,7 @@ xchk_quota_item(
int error = 0; int error = 0;
if (xchk_should_terminate(sc, &error)) if (xchk_should_terminate(sc, &error))
return -ECANCELED; return error;
/* /*
* Except for the root dquot, the actual dquot we got must either have * Except for the root dquot, the actual dquot we got must either have
......
...@@ -61,7 +61,6 @@ xrep_attempt( ...@@ -61,7 +61,6 @@ xrep_attempt(
sc->flags |= XREP_ALREADY_FIXED; sc->flags |= XREP_ALREADY_FIXED;
return -EAGAIN; return -EAGAIN;
case -EDEADLOCK: case -EDEADLOCK:
case -EAGAIN:
/* Tell the caller to try again having grabbed all the locks. */ /* Tell the caller to try again having grabbed all the locks. */
if (!(sc->flags & XCHK_TRY_HARDER)) { if (!(sc->flags & XCHK_TRY_HARDER)) {
sc->flags |= XCHK_TRY_HARDER; sc->flags |= XCHK_TRY_HARDER;
...@@ -70,10 +69,15 @@ xrep_attempt( ...@@ -70,10 +69,15 @@ xrep_attempt(
/* /*
* We tried harder but still couldn't grab all the resources * We tried harder but still couldn't grab all the resources
* we needed to fix it. The corruption has not been fixed, * we needed to fix it. The corruption has not been fixed,
* so report back to userspace. * so exit to userspace with the scan's output flags unchanged.
*/ */
return -EFSCORRUPTED; return 0;
default: default:
/*
* EAGAIN tells the caller to re-scrub, so we cannot return
* that here.
*/
ASSERT(error != -EAGAIN);
return error; return error;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册