Re: [PATCH] btrfs: Fix superblock csum type check.

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

 



On Tue, Apr 28, 2015 at 09:06:03AM +0800, Qu Wenruo wrote:
> Old csum type check is wrong and can't catch csum_type 1(not supported).
> 
> Fix it to avoid hostile 0 division.
> 
> Reported-by: Lukas Lueg <lukas.lueg@xxxxxxxxx>
> Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>

Reviewed-by: David Sterba <dsterba@xxxxxxx>

> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -428,7 +428,7 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
>  
>  	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
>  		printk(KERN_ERR "BTRFS: unsupported checksum algorithm %u\n",
> -				csum_type);
> +		       csum_type);

Please avoid unrelated changes.

>  		ret = 1;
>  	}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux