All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Fix superblock csum type check.
Date: Wed, 29 Apr 2015 19:23:07 +0200	[thread overview]
Message-ID: <20150429172307.GD4996@twin.jikos.cz> (raw)
In-Reply-To: <1430183163-10870-1-git-send-email-quwenruo@cn.fujitsu.com>

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@gmail.com>
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>

Reviewed-by: David Sterba <dsterba@suse.cz>

> --- 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;
>  	}

  reply	other threads:[~2015-04-29 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28  1:06 [PATCH] btrfs: Fix superblock csum type check Qu Wenruo
2015-04-29 17:23 ` David Sterba [this message]
2015-04-30  0:33   ` Qu Wenruo
2015-05-04 16:08     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150429172307.GD4996@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.