mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Vivek Goyal <vgoyal@redhat.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 16:48:50 +0200	[thread overview]
Message-ID: <20110222144850.GB4759@swordfish.minsk.epam.com> (raw)
In-Reply-To: <20110222142050.GB28269@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]

On (02/22/11 09:20), Vivek Goyal wrote:
> 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.
> 

Hi Vivek,

Sure, fixing the even probability of NULL queue_lock is better (correct/sane/etc.) 
then fixing NULL queue_lock in `different places'. I'm presonally OK with dropping 
my patch.

By the way, I guess we should Cc stable when we decide which one [fix] will land 
on the mainline (taking in account that we're on -rc6 already).

Side Note: Need to check if .37 is affected (I suspect it is).


	Sergey

[-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --]

  reply	other threads:[~2011-02-22 14:50 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
2011-02-22 14:48       ` Sergey Senozhatsky [this message]
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
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=20110222144850.GB4759@swordfish.minsk.epam.com \
    --to=sergey.senozhatsky@gmail.com \
    --cc=jaxboe@fusionio.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=snitzer@redhat.com \
    --cc=tj@kernel.org \
    --cc=vgoyal@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®