public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: linux-kernel@vger.kernel.org, jaxboe@fusionio.com, neilb@suse.de,
	tj@kernel.org, jmoyer@redhat.com, snitzer@redhat.com
Subject: Re: [PATCH 2/3] loop: No need to initialize ->queue_lock explicitly before calling blk_cleanup_queue()
Date: Tue, 22 Feb 2011 09:20:51 -0500	[thread overview]
Message-ID: <20110222142050.GB28269@redhat.com> (raw)
In-Reply-To: <20110222073032.GA4555@swordfish.minsk.epam.com>

On Tue, Feb 22, 2011 at 09:30:32AM +0200, Sergey Senozhatsky wrote:
> On (02/21/11 22:53), Vivek Goyal wrote:
> > o Now we initialize ->queue_lock at queue allocation time so driver does
> >   not have to worry about initializing it before calling blk_cleanup_queue().
> > 
> > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> > ---
> >  drivers/block/loop.c |    3 ---
> >  1 files changed, 0 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> > index 49e6a54..44e18c0 100644
> > --- a/drivers/block/loop.c
> > +++ b/drivers/block/loop.c
> > @@ -1641,9 +1641,6 @@ out:
> >  
> >  static void loop_free(struct loop_device *lo)
> >  {
> > -	if (!lo->lo_queue->queue_lock)
> > -		lo->lo_queue->queue_lock = &lo->lo_queue->__queue_lock;
> > -
> >  	blk_cleanup_queue(lo->lo_queue);
> >  	put_disk(lo->lo_disk);
> >  	list_del(&lo->lo_list);
> 
> Hi,
> 
> (just for note) 
> There is an incremental patch fixing this case in Andrew's mm tree: 
> https://lkml.org/lkml/2011/2/11/165
>                                    
> (block-fix-queue_lock-null-pointer-derefence-in-blk_throtl_exit-v4.patch
> added to -mm tree).

Hi Sergey,

Thinking more about it, initializing queue lock in blk_alloc_queue() seems
to be even more cleaner to me instead of initializing it to internal lock
during blk_cleanup_queue(). If others like the idea, then we can either
ask Andrew to drop the patch or I can generate one on top of it.

Thanks
Vivek

  reply	other threads:[~2011-02-22 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22  3:53 [PATCH 0/3] [RFC] block: Enforce that ->queue_lock is initialized during call to blk_cleanup_queue() Vivek Goyal
2011-02-22  3:53 ` [PATCH 1/3] block: Initialize ->queue_lock to internal lock at queue allocation time Vivek Goyal
2011-02-22  3:53 ` [PATCH 2/3] loop: No need to initialize ->queue_lock explicitly before calling blk_cleanup_queue() Vivek Goyal
2011-02-22  7:30   ` Sergey Senozhatsky
2011-02-22 14:20     ` Vivek Goyal [this message]
2011-02-22 14:48       ` Sergey Senozhatsky
2011-02-22  3:53 ` [PATCH 3/3] block: Move blk_throtl_exit() call to blk_cleanup_queue() Vivek Goyal
2011-02-22  4:20 ` [PATCH 0/3] [RFC] block: Enforce that ->queue_lock is initialized during " NeilBrown
2011-02-22 14:17   ` Vivek Goyal
  -- strict thread matches above, loose matches on Subject: below --
2011-02-28 19:25 [PATCH 0/3] block: Few fixes for throttle and blk_cleanup_queue() Vivek Goyal
2011-02-28 19:25 ` [PATCH 2/3] loop: No need to initialize ->queue_lock explicitly before calling blk_cleanup_queue() Vivek Goyal

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=20110222142050.GB28269@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=jaxboe@fusionio.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=snitzer@redhat.com \
    --cc=tj@kernel.org \
    /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