Re: [PATCH 1/2] ext4: Replace open coded mdata csum feature to helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry Monakhov <dmonakhov@xxxxxxxxxx> writes:
<Snim>
ext4_fill_super:
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
> -				       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
Oh Crap. Next two lines shows that I've not tested this patch with
metadata_csum enabled :( .Please ignore this version. I'll send updated version.
> +	if (ext4_has_metadata_csum(sb)) {
>  		sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0);

>  		if (IS_ERR(sbi->s_chksum_driver)) {
>  			ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver.");
> @@ -3508,8 +3501,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	}
>  
>  	/* Precompute checksum seed for all metadata */
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
> -			EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
> +	if (ext4_has_metadata_csum(sb))
>  		sbi->s_csum_seed = ext4_chksum(sbi, ~0, es->s_uuid,
>  					       sizeof(es->s_uuid));
>  
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 42823ab..1e09fc7 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -142,8 +142,7 @@ static int ext4_xattr_block_csum_verify(struct inode *inode,
>  					sector_t block_nr,
>  					struct ext4_xattr_header *hdr)
>  {
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> -		EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
> +	if (ext4_has_metadata_csum(inode->i_sb) &&
>  	    (hdr->h_checksum != ext4_xattr_block_csum(inode, block_nr, hdr)))
>  		return 0;
>  	return 1;
> @@ -153,8 +152,7 @@ static void ext4_xattr_block_csum_set(struct inode *inode,
>  				      sector_t block_nr,
>  				      struct ext4_xattr_header *hdr)
>  {
> -	if (!EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> -		EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
> +	if (!ext4_has_metadata_csum(inode->i_sb))
>  		return;
>  
>  	hdr->h_checksum = ext4_xattr_block_csum(inode, block_nr, hdr);
> -- 
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: pgp0WqO21nbwr.pgp
Description: PGP signature


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux