From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, bgoncalv@redhat.com,
m.szyprowski@samsung.com
Subject: [PATCH 2/2] loop: fix order of cleaning up the queue and freeing the tagset
Date: Wed, 16 Jun 2021 09:15:47 +0200 [thread overview]
Message-ID: <20210616071547.1156283-2-hch@lst.de> (raw)
In-Reply-To: <20210616071547.1156283-1-hch@lst.de>
We must release the queue before freeing the tagset.
Fixes: 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
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 9a48b3f9a15c..e0c4de392eab 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2172,8 +2172,8 @@ static int loop_add(struct loop_device **l, int i)
static void loop_remove(struct loop_device *lo)
{
del_gendisk(lo->lo_disk);
- blk_mq_free_tag_set(&lo->tag_set);
blk_cleanup_disk(lo->lo_disk);
+ blk_mq_free_tag_set(&lo->tag_set);
mutex_destroy(&lo->lo_mutex);
kfree(lo);
}
--
2.30.2
next prev parent reply other threads:[~2021-06-16 7:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-16 7:15 [PATCH 1/2] mtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev Christoph Hellwig
2021-06-16 7:15 ` Christoph Hellwig [this message]
2021-06-16 12:54 ` 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=20210616071547.1156283-2-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bgoncalv@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=m.szyprowski@samsung.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;
as well as URLs for NNTP newsgroup(s).