public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 13/13] xfs: add CRC checks for quota blocks
Date: Thu, 12 Feb 2009 01:41:28 -0500	[thread overview]
Message-ID: <20090212064128.GC824@josefsipek.net> (raw)
In-Reply-To: <20090210202941.616680000@bombadil.infradead.org>

On Tue, Feb 10, 2009 at 03:22:54PM -0500, Christoph Hellwig wrote:
> Use the reserved space in struct xfs_dqblk to store a UUID and a crc
> for the quota blocks.
> 
> I'm pondering if we should just move the crc check into xfs_qm_dqcheck
> where all the other validity checks are located.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: xfs/fs/xfs/xfs_quota.h
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_quota.h	2009-02-09 08:47:34.234069111 +0100
> +++ xfs/fs/xfs/xfs_quota.h	2009-02-10 20:15:36.874947481 +0100
> @@ -77,7 +77,13 @@ typedef struct	xfs_disk_dquot {
>   */
>  typedef struct xfs_dqblk {
>  	xfs_disk_dquot_t  dd_diskdq;	/* portion that lives incore as well */
> -	char		  dd_fill[32];	/* filling for posterity */
> +	char		  dd_fill[12];	/* filling for posterity */
> +
> +	/*
> +	 * These two are only present one filesystems with the CRC bits set.
> +	 */
> +	__be32		  dd_crc;	/* checksum */
> +	uuid_t		  dd_uuid;	/* location information */
>  } xfs_dqblk_t;

Again, why put the crc/uuid at the end?

> Index: xfs/fs/xfs/quota/xfs_dquot.c
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_dquot.c	2009-02-10 19:55:01.982070089 +0100
> +++ xfs/fs/xfs/quota/xfs_dquot.c	2009-02-10 20:23:25.618944664 +0100
> @@ -368,6 +369,40 @@ xfs_qm_adjust_dqtimers(
...
> +STATIC int
> +xfs_dquot_verify_crc(
> +	struct xfs_mount	*mp,
> +	struct xfs_buf		*bp)
> +{
> +	struct xfs_dqblk	*d = (struct xfs_dqblk *)XFS_BUF_PTR(bp);
> +	int			i;
> +
> +	for (i = 0; i < XFS_QM_DQPERBLK(mp); i++, d++) {
> +		if (!xfs_verify_cksum((char *)d, sizeof(struct xfs_dqblk),
> +				 offsetof(struct xfs_dqblk, dd_crc))) {
> +//		    !uuid_equal(&agfl->agfl_uuid, &mp->m_sb.sb_uuid) ||

Dead code?

Josef 'Jeff' Sipek.

-- 
FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #19
A:      To be or not to be.
Q:      What is the square root of 4b^2?

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2009-02-12  6:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 20:22 [PATCH 00/13] Updated CRC patches Christoph Hellwig
2009-02-10 20:22 ` [PATCH 01/13] xfs: cleanup xlog_bread Christoph Hellwig
2009-02-10 20:22 ` [PATCH 02/13] xfs: remove m_litino Christoph Hellwig
2009-02-10 20:22 ` [PATCH 03/13] xfs: remove m_attroffset Christoph Hellwig
2009-02-10 20:22 ` [PATCH 04/13] xfs: take inode version into account in XFS_LITINO Christoph Hellwig
2009-02-10 20:22 ` [PATCH 05/13] xfs: add CRC infrastructure Christoph Hellwig
2009-02-12  6:10   ` Josef 'Jeff' Sipek
2009-02-10 20:22 ` [PATCH 06/13] xfs: add support for large btree blocks Christoph Hellwig
2009-02-10 20:22 ` [PATCH 07/13] xfs: add CRC checks to the superblock Christoph Hellwig
2009-02-10 20:22 ` [PATCH 08/13] xfs: add CRC checks to the AGF Christoph Hellwig
2009-02-10 20:22 ` [PATCH 09/13] xfs: add CRC checks to the AGI Christoph Hellwig
2009-02-10 20:22 ` [PATCH 10/13] xfs: add CRC checks to the AGFL Christoph Hellwig
2009-02-11  7:54   ` Dave Chinner
2009-02-15 18:23     ` Christoph Hellwig
2009-02-10 20:22 ` [PATCH 11/13] xfs: add CRC checks to the log Christoph Hellwig
2009-02-10 20:22 ` [PATCH 12/13] xfs: add version 3 inode format with CRCs Christoph Hellwig
2009-02-12  6:38   ` Josef 'Jeff' Sipek
2009-02-12 18:42     ` Eric Sandeen
2009-02-12 18:51       ` Christoph Hellwig
2009-02-10 20:22 ` [PATCH 13/13] xfs: add CRC checks for quota blocks Christoph Hellwig
2009-02-12  6:41   ` Josef 'Jeff' Sipek [this message]
2009-02-13 20:10     ` 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=20090212064128.GC824@josefsipek.net \
    --to=jeffpc@josefsipek.net \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /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