All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 4/5] xfs: add full xfs_dqblk verifier
Date: Mon, 7 May 2018 08:10:42 -0700	[thread overview]
Message-ID: <20180507151042.GE22414@infradead.org> (raw)
In-Reply-To: <e3e2b0af-c505-8164-5868-c9e05fc1edcc@sandeen.net>

On Fri, May 04, 2018 at 12:35:05PM -0500, Eric Sandeen wrote:
> Add an xfs_dqblk verifier so that it can check the uuid on V5 filesystems;
> it calls the existing xfs_dquot_verify verifier to validate the
> xfs_disk_dquot_t contained inside it.  This lets us move the uuid
> verification out of the crc verifier, which makes little sense.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>  fs/xfs/libxfs/xfs_dquot_buf.c  | 27 ++++++++++++++++++++++-----
>  fs/xfs/libxfs/xfs_quota_defs.h |  2 ++
>  fs/xfs/xfs_dquot.c             | 10 +++++-----
>  fs/xfs/xfs_qm.c                |  2 +-
>  4 files changed, 30 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
> index 3b92427883fa..d71c0b53536b 100644
> --- a/fs/xfs/libxfs/xfs_dquot_buf.c
> +++ b/fs/xfs/libxfs/xfs_dquot_buf.c
> @@ -41,7 +41,12 @@ xfs_calc_dquots_per_chunk(
>  
>  /*
>   * Do some primitive error checking on ondisk dquot data structures.
> + *
> + * The xfs_dqblk structure /contains/ the xfs_disk_dquot structure;
> + * we verify them separately because at some points we have only the
> + * smaller xfs_disk_dquot structure available.
>   */
> +
>  xfs_failaddr_t
>  xfs_dquot_verify(
>  	struct xfs_mount *mp,
> @@ -100,6 +105,20 @@ xfs_dquot_verify(
>  	return NULL;
>  }
>  
> +xfs_failaddr_t
> +xfs_dqblk_verify(
> +	struct xfs_mount	*mp,
> +	struct xfs_dqblk	*dqb,
> +	xfs_dqid_t	 	id,
> +	uint		 	type)	/* used only during quotacheck */
> +{
> +	if (xfs_sb_version_hascrc(&mp->m_sb) &&
> +	    !uuid_equal(&dqb->dd_uuid, &mp->m_sb.sb_meta_uuid))
> +			return __this_address;

Double indentation for the return statement.

>  	struct xfs_mount	*mp,
>  	struct xfs_buf		*bp)
>  {
> -	struct xfs_dqblk	*d = (struct xfs_dqblk *)bp->b_addr;
> +	struct xfs_dqblk	*dqb = (struct xfs_dqblk *)bp->b_addr;

No need for the cast, b_addr is a void pointer.

Otherwise looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  parent reply	other threads:[~2018-05-07 15:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 17:33 [PATCH 0/5] xfs: quota verifier/repair improvements take 2 Eric Sandeen
2018-05-04 17:34 ` [PATCH 1/5] xfs: remove unused flags arg from xfs_dquot_verify Eric Sandeen
2018-05-04 17:34 ` [PATCH 2/5] xfs: check type in quota verifier during quotacheck Eric Sandeen
2018-05-04 22:08   ` Darrick J. Wong
2018-05-07 15:07   ` Christoph Hellwig
2018-05-04 17:34 ` [PATCH 3/5] xfs: repair full xfs_dqblk " Eric Sandeen
2018-05-04 22:09   ` Darrick J. Wong
2018-05-07 15:09   ` Christoph Hellwig
2018-05-07 15:22   ` [PATCH 3/5 V2] xfs: pass full xfs_dqblk to repair " Eric Sandeen
2018-05-07 16:15     ` Darrick J. Wong
2018-05-04 17:35 ` [PATCH 4/5] xfs: add full xfs_dqblk verifier Eric Sandeen
2018-05-04 22:09   ` Darrick J. Wong
2018-05-07 15:10   ` Christoph Hellwig [this message]
2018-05-07 15:20   ` [PATCH 4/5 V2] " Eric Sandeen
2018-05-04 17:35 ` [PATCH 5/5] xfs: print specific dqblk that failed verifiers Eric Sandeen
2018-05-04 21:46   ` [PATCH 6/5] xfs: make several functions void Eric Sandeen
2018-05-04 22:29     ` Darrick J. Wong
2018-05-04 22:36       ` Eric Sandeen
2018-05-04 22:10   ` [PATCH 5/5] xfs: print specific dqblk that failed verifiers Darrick J. Wong
2018-05-07 15:11   ` Christoph Hellwig

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=20180507151042.GE22414@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.