[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20110902184332.GG12086@tux1.beaverton.ibm.com>
Date: Fri, 2 Sep 2011 11:43:32 -0700
From: "Darrick J. Wong" <djwong@...ibm.com>
To: Andreas Dilger <adilger.kernel@...ger.ca>
Cc: Theodore Tso <tytso@....edu>,
Sunil Mushran <sunil.mushran@...cle.com>,
Amir Goldstein <amir73il@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>,
Mingming Cao <cmm@...ibm.com>,
Joel Becker <jlbec@...lplan.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-ext4@...r.kernel.org, Coly Li <colyli@...il.com>
Subject: Re: [PATCH 13/16] ext4: Calculate and verify checksums of extended
attribute blocks
On Thu, Sep 01, 2011 at 01:42:26AM -0600, Andreas Dilger wrote:
> On 2011-08-31, at 6:32 PM, Darrick J. Wong wrote:
> > Calculate and verify the checksums of extended attribute blocks. This only
> > applies to separate EA blocks that are pointed to by inode->i_file_acl (i.e.
> > external EA blocks); the checksum lives in the EA header.
> >
> > diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
> > index 25b7387..b2b20af 100644
> > --- a/fs/ext4/xattr.h
> > +++ b/fs/ext4/xattr.h
> > @@ -27,7 +27,8 @@ struct ext4_xattr_header {
> > __le32 h_refcount; /* reference count */
> > __le32 h_blocks; /* number of disk blocks used */
> > __le32 h_hash; /* hash value of all attributes */
> > - __u32 h_reserved[4]; /* zero right now */
> > + __le32 h_checksum; /* crc32c(uuid+inum+xattrblock) */
>
> This comment is incorrect - the inum cannot be part of the checksum if
> the block is shared. That said, I wouldn't object if the checksum DID
> include the inum if the block was not shared (h_refcount == 1). Since
> the h_refcount needs to be modified and the checksum recomputed if other
> inodes share this block, this doesn't impose any extra overhead.
Oops, I guess I was typing too fast. "inum" should be "ea_block_num". Though
I suspect that in the common case files don't share EA blocks, so we could do
inum when refcount==1.
--D
>
> Cheers, Andreas
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists