Linux Device Mapper development
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	axboe@kernel.dk, viro@zeniv.linux.org.uk, dm-devel@redhat.com
Subject: Re: [PATCH 5/7] md: use block_device name vsprintf helper
Date: Tue, 14 Apr 2015 11:43:15 +0200	[thread overview]
Message-ID: <20150414094315.GJ23327@quack.suse.cz> (raw)
In-Reply-To: <1428928300-9132-6-git-send-email-dmonakhov@openvz.org>

On Mon 13-04-15 16:31:38, Dmitry Monakhov wrote:
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
...
> @@ -2610,7 +2597,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  	struct bio *bio;
>  	struct r10conf *conf = mddev->private;
>  	struct md_rdev *rdev = r10_bio->devs[slot].rdev;
> -	char b[BDEVNAME_SIZE];
>  	unsigned long do_sync;
>  	int max_sectors;
>  
> @@ -2623,7 +2609,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  	 * frozen.
>  	 */
>  	bio = r10_bio->devs[slot].bio;
> -	bdevname(bio->bi_bdev, b);
>  	bio_put(bio);
>  	r10_bio->devs[slot].bio = NULL;
>  
> @@ -2639,9 +2624,9 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  read_more:
>  	rdev = read_balance(conf, r10_bio, &max_sectors);
>  	if (rdev == NULL) {
> -		printk(KERN_ALERT "md/raid10:%s: %s: unrecoverable I/O"
> +		printk(KERN_ALERT "md/raid10:%s: %pg: unrecoverable I/O"
>  		       " read error for block %llu\n",
> -		       mdname(mddev), b,
> +		       mdname(mddev), bio->bi_bdev,
>  		       (unsigned long long)r10_bio->sector);
>  		raid_end_bio_io(r10_bio);
>  		return;
  So it seems to me that in the above, you'll reference bio->bi_bdev of an
already free bio since the code does bio_put() just after calling
bdevname()...

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2015-04-14  9:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 12:31 [PATCH 0/7] fs: add blkdev name format specifier v2 Dmitry Monakhov
2015-04-13 12:31 ` [PATCH 1/7] fs: use gendisk->disk_name where possible Dmitry Monakhov
2015-04-14  9:13   ` Jan Kara
2015-04-13 12:31 ` [PATCH 2/7] lib/vsprintf: add %*pg format specifier Dmitry Monakhov
2015-04-14  9:15   ` Jan Kara
2015-04-13 12:31 ` [PATCH 3/7] block: use block_device name vsprintf helper Dmitry Monakhov
2015-04-14  9:16   ` Jan Kara
2015-04-13 12:31 ` [PATCH 4/7] fs: " Dmitry Monakhov
2015-04-14  9:22   ` Jan Kara
2015-04-13 12:31 ` [PATCH 5/7] md: " Dmitry Monakhov
2015-04-14  9:43   ` Jan Kara [this message]
2015-04-13 12:31 ` [PATCH 6/7] block/partitions: use block_device name vsprintf helper v2 Dmitry Monakhov
2015-04-14  9:23   ` Jan Kara
2015-04-13 12:31 ` [PATCH 7/7] drivers: use block_device name vsprintf helper Dmitry Monakhov
2015-04-14  9:24   ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2015-03-31 16:01 [RFC] [PATCH 0/7] fs: add blkdev name format specifier Dmitry Monakhov
2015-03-31 16:01 ` [PATCH 5/7] md: use block_device name vsprintf helper Dmitry Monakhov

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=20150414094315.GJ23327@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox