[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111205162406.GB32031@thunk.org>
Date: Mon, 5 Dec 2011 11:24:06 -0500
From: Ted Ts'o <tytso@....edu>
To: "Darrick J. Wong" <djwong@...ibm.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH 06/22] ext4: Calculate and verify inode checksums
On Mon, Nov 28, 2011 at 03:26:56PM -0800, Darrick J. Wong wrote:
> + /* Precompute second piece of csum */
> + if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
> + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
> + __u32 csum;
> + struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
> + __le32 inum = cpu_to_le32(inode->i_ino);
> + __le32 gen = cpu_to_le32(inode->i_generation);
> + csum = ext4_chksum(sbi, sbi->s_uuid_csum, (__u8 *)&inum,
> + sizeof(inum));
> + ei->i_uuid_inum_csum = ext4_chksum(sbi, csum, (__u8 *)&gen,
> + sizeof(gen));
> + }
Why do we include a copy of i_generation in the precomputed initial
part of the checksum? Since i_generation is in the raw, on-disk
version of the inode, what's the rationale for including it here? It
shouldn't *hurt*, but it a few extra CPU cycles, and I'm not seeing
how it helps.
- Ted
--
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