From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n1C6gZRp226143 for ; Thu, 12 Feb 2009 00:42:35 -0600 Received: from josefsipek.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BAA951122FD for ; Wed, 11 Feb 2009 22:41:59 -0800 (PST) Received: from josefsipek.net (josefsipek.net [141.211.133.196]) by cuda.sgi.com with ESMTP id 9Cj02CddPjNe0QYr for ; Wed, 11 Feb 2009 22:41:59 -0800 (PST) Date: Thu, 12 Feb 2009 01:41:28 -0500 From: "Josef 'Jeff' Sipek" Subject: Re: [PATCH 13/13] xfs: add CRC checks for quota blocks Message-ID: <20090212064128.GC824@josefsipek.net> References: <20090210202241.546501000@bombadil.infradead.org> <20090210202941.616680000@bombadil.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090210202941.616680000@bombadil.infradead.org> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Christoph Hellwig Cc: xfs@oss.sgi.com 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 > > 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