lkml.org 
[lkml]   [2011]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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
    >


    \
     
     \ /
      Last update: 2011-09-02 20:45    [W:4.063 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site