linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Ben Hutchings <ben@decadent.org.uk>, Jens Axboe <axboe@kernel.dk>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [floppy, blk_peek_request] BUG: scheduling while atomic: kworker/u:0/6/0x10000002
Date: Mon, 5 Nov 2012 11:36:19 -0500	[thread overview]
Message-ID: <20121105163618.GA28720@redhat.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1211051632460.24253@pobox.suse.cz>

On Mon, Nov 05, 2012 at 04:33:35PM +0100, Jiri Kosina wrote:
> On Mon, 5 Nov 2012, Herton Ronaldo Krzesinski wrote:
> 
> > > Fengguang, does the patch below make any difference for you please?
> > > 
> > > Thanks.
> > 
> > Yes, I saw the same thing here, destroy_workqueue should be done before
> > clearing the queue (blk_cleanup_queue) indeed. user_reset_fdc called
> > process_fd_request and that scheduled redo_fd_request, that tries to
> > take the queue already cleaned up in set_next_request I expect.
> > 
> > > 
> > > 
> > > 
> > > 
> > >  drivers/block/floppy.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> > > index 1c49d71..3b9cc0f 100644
> > > --- a/drivers/block/floppy.c
> > > +++ b/drivers/block/floppy.c
> > > @@ -4329,6 +4329,7 @@ out_unreg_region:
> > >  	platform_driver_unregister(&floppy_driver);
> > >  out_unreg_blkdev:
> > >  	unregister_blkdev(FLOPPY_MAJOR, "fd");
> > > +	destroy_workqueue(floppy_wq);
> > 
> > This should go right after the out_put_disk label, otherwise we may
> > leak the floppy_wq on early error.
> 
> Indeed.
> 
> Fengguang, could you please test with the patch below instead? (it should 
> be functionally equivalent in most of the cases though).
> 

What about floppy_module_exit(). There also we seem to cleanup the queue
first before flushing and destroying floppy_wq workqueue.

Thanks
Vivek

> 
> 
> 
>  drivers/block/floppy.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 1c49d71..e386d83 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c
> @@ -4330,6 +4330,7 @@ out_unreg_region:
>  out_unreg_blkdev:
>  	unregister_blkdev(FLOPPY_MAJOR, "fd");
>  out_put_disk:
> +	destroy_workqueue(floppy_wq);
>  	for (drive = 0; drive < N_DRIVE; drive++) {
>  		if (!disks[drive])
>  			break;
> @@ -4340,7 +4341,6 @@ out_put_disk:
>  		}
>  		put_disk(disks[drive]);
>  	}
> -	destroy_workqueue(floppy_wq);
>  	return err;
>  }
>  
> 
> -- 
> Jiri Kosina
> SUSE Labs

  reply	other threads:[~2012-11-05 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05  7:01 [floppy, blk_peek_request] BUG: scheduling while atomic: kworker/u:0/6/0x10000002 Fengguang Wu
2012-11-05 13:20 ` Fengguang Wu
2012-11-05 13:24 ` Jiri Kosina
2012-11-05 13:34   ` Jiri Kosina
2012-11-05 15:27     ` Herton Ronaldo Krzesinski
2012-11-05 15:33       ` Jiri Kosina
2012-11-05 16:36         ` Vivek Goyal [this message]
2012-11-05 16:53           ` Jiri Kosina
2012-11-06  0:48         ` Fengguang Wu
2012-11-05 13:38   ` Fengguang Wu

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=20121105163618.GA28720@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=ben@decadent.org.uk \
    --cc=fengguang.wu@intel.com \
    --cc=herton.krzesinski@canonical.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).