public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@wdc.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	Josef Bacik <jbacik@fb.com>, Shaohua Li <shli@fb.com>,
	Omar Sandoval <osandov@fb.com>, Hannes Reinecke <hare@suse.com>,
	Ming Lei <ming.lei@redhat.com>
Subject: [PATCH v4 1/6] block/loop: Delete gendisk before cleaning up the request queue
Date: Thu, 22 Feb 2018 17:08:03 -0800	[thread overview]
Message-ID: <20180223010808.25765-2-bart.vanassche@wdc.com> (raw)
In-Reply-To: <20180223010808.25765-1-bart.vanassche@wdc.com>

Remove the disk, partition and bdi sysfs attributes before cleaning up
the request queue associated with the disk.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Ming Lei <ming.lei@redhat.com>
---
 drivers/block/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d5fe720cf149..8b693fdd08dc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1864,8 +1864,8 @@ static int loop_add(struct loop_device **l, int i)
 
 static void loop_remove(struct loop_device *lo)
 {
-	blk_cleanup_queue(lo->lo_queue);
 	del_gendisk(lo->lo_disk);
+	blk_cleanup_queue(lo->lo_queue);
 	blk_mq_free_tag_set(&lo->tag_set);
 	put_disk(lo->lo_disk);
 	kfree(lo);
-- 
2.16.2

  reply	other threads:[~2018-02-23  1:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23  1:08 [PATCH v4 0/6] Fix races between blkcg code and request queue initialization and cleanup Bart Van Assche
2018-02-23  1:08 ` Bart Van Assche [this message]
2018-02-23  8:22   ` [PATCH v4 1/6] block/loop: Delete gendisk before cleaning up the request queue Johannes Thumshirn
2018-02-23  9:49   ` Joseph Qi
2018-02-23  1:08 ` [PATCH v4 2/6] md: " Bart Van Assche
2018-02-23  8:22   ` Johannes Thumshirn
2018-02-23  9:50   ` Joseph Qi
2018-02-23  1:08 ` [PATCH v4 3/6] zram: " Bart Van Assche
2018-02-23  8:23   ` Johannes Thumshirn
2018-02-23  9:51   ` Joseph Qi
2018-02-23  1:08 ` [PATCH v4 4/6] block: Add a third argument to blk_alloc_queue_node() Bart Van Assche
2018-02-23  8:26   ` Johannes Thumshirn
2018-02-23 16:07     ` Bart Van Assche
2018-02-23  9:48   ` Joseph Qi
2018-02-23  1:08 ` [PATCH v4 5/6] block: Fix a race between the cgroup code and request queue initialization Bart Van Assche
2018-02-23  9:52   ` Joseph Qi
2018-02-23  1:08 ` [PATCH v4 6/6] block: Fix a race between request queue removal and the block cgroup controller Bart Van Assche
2018-02-23  9:54   ` Joseph Qi
2018-02-24 12:44 ` [PATCH v4 0/6] Fix races between blkcg code and request queue initialization and cleanup Ming Lei
2018-02-27 23:37   ` Bart Van Assche
2018-02-27 23:37 ` Bart Van Assche
2018-02-28 15:33   ` Jens Axboe

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=20180223010808.25765-2-bart.vanassche@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jbacik@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=shli@fb.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