From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/4] xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata
Date: Mon, 28 Oct 2019 14:19:22 -0400 [thread overview]
Message-ID: <20191028181922.GE26529@bfoster> (raw)
In-Reply-To: <157198051168.2873445.9385238357724841029.stgit@magnolia>
On Thu, Oct 24, 2019 at 10:15:11PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> There are a few places where we return -EIO instead of -EFSCORRUPTED
> when we find corrupt metadata. Fix those places.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_bmap.c | 6 +++---
> fs/xfs/xfs_attr_inactive.c | 6 +++---
> fs/xfs/xfs_dquot.c | 2 +-
> 3 files changed, 7 insertions(+), 7 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 02469d59c787..587889585a23 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -1374,7 +1374,7 @@ xfs_bmap_last_before(
> case XFS_DINODE_FMT_EXTENTS:
> break;
> default:
> - return -EIO;
> + return -EFSCORRUPTED;
> }
>
> if (!(ifp->if_flags & XFS_IFEXTENTS)) {
> @@ -1475,7 +1475,7 @@ xfs_bmap_last_offset(
>
> if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE &&
> XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS)
> - return -EIO;
> + return -EFSCORRUPTED;
>
> error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty);
> if (error || is_empty)
> @@ -5864,7 +5864,7 @@ xfs_bmap_insert_extents(
> del_cursor);
>
> if (stop_fsb >= got.br_startoff + got.br_blockcount) {
> - error = -EIO;
> + error = -EFSCORRUPTED;
> goto del_cursor;
> }
>
> diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
> index a640a285cc52..f83f11d929e4 100644
> --- a/fs/xfs/xfs_attr_inactive.c
> +++ b/fs/xfs/xfs_attr_inactive.c
> @@ -209,7 +209,7 @@ xfs_attr3_node_inactive(
> */
> if (level > XFS_DA_NODE_MAXDEPTH) {
> xfs_trans_brelse(*trans, bp); /* no locks for later trans */
> - return -EIO;
> + return -EFSCORRUPTED;
> }
>
> node = bp->b_addr;
> @@ -258,7 +258,7 @@ xfs_attr3_node_inactive(
> error = xfs_attr3_leaf_inactive(trans, dp, child_bp);
> break;
> default:
> - error = -EIO;
> + error = -EFSCORRUPTED;
> xfs_trans_brelse(*trans, child_bp);
> break;
> }
> @@ -341,7 +341,7 @@ xfs_attr3_root_inactive(
> error = xfs_attr3_leaf_inactive(trans, dp, bp);
> break;
> default:
> - error = -EIO;
> + error = -EFSCORRUPTED;
> xfs_trans_brelse(*trans, bp);
> break;
> }
> diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
> index aeb95e7391c1..2b87c96fb2c0 100644
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -1126,7 +1126,7 @@ xfs_qm_dqflush(
> xfs_buf_relse(bp);
> xfs_dqfunlock(dqp);
> xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
> - return -EIO;
> + return -EFSCORRUPTED;
> }
>
> /* This is the only portion of data that needs to persist */
>
next prev parent reply other threads:[~2019-10-28 18:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 5:14 [PATCH 0/4] xfs: more metadata verifier tightening Darrick J. Wong
2019-10-25 5:14 ` [PATCH 1/4] xfs: check attribute leaf block structure Darrick J. Wong
2019-10-28 18:18 ` Brian Foster
2019-10-28 18:27 ` Darrick J. Wong
2019-10-25 5:14 ` [PATCH 2/4] xfs: namecheck attribute names before listing them Darrick J. Wong
2019-10-28 18:18 ` Brian Foster
2019-10-28 18:22 ` Darrick J. Wong
2019-10-25 5:15 ` [PATCH 3/4] xfs: namecheck directory entry " Darrick J. Wong
2019-10-25 12:56 ` Christoph Hellwig
2019-10-25 16:04 ` Darrick J. Wong
2019-10-29 7:16 ` Christoph Hellwig
2019-10-29 16:23 ` Darrick J. Wong
2019-10-30 21:32 ` Christoph Hellwig
2019-10-30 22:18 ` Darrick J. Wong
2019-10-28 18:19 ` Brian Foster
2019-10-28 18:23 ` Darrick J. Wong
2019-10-25 5:15 ` [PATCH 4/4] xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata Darrick J. Wong
2019-10-25 12:54 ` Christoph Hellwig
2019-10-28 18:19 ` Brian Foster [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-10-29 4:03 [PATCH v2 0/4] xfs: more metadata verifier tightening Darrick J. Wong
2019-10-29 4:04 ` [PATCH 4/4] xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191028181922.GE26529@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox