[PATCH 13/13] xfs: add CRC checks for quota blocks

Christoph Hellwig hch at infradead.org
Fri Feb 13 14:10:24 CST 2009


On Thu, Feb 12, 2009 at 01:41:28AM -0500, Josef 'Jeff' Sipek wrote:
> >  	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?

So that we can add additional infos either to xfs_disk_dquot_t
(preserved in-core) or xfs_dqblk_t (purly on-disk).

> > +		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?

Sorry, sent out a too early version.  The final patch actually verifies
the uuid and the correct location in the quota file.




More information about the xfs mailing list