From: Josef Bacik <josef@toxicpanda.com>
To: axboe@kernel.dk, nbd@other.debian.org,
linux-block@vger.kernel.org, kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: [PATCH 5/5] nbd: call nbd_bdev_reset instead of bd_set_size on disconnect
Date: Wed, 16 May 2018 14:36:05 -0400 [thread overview]
Message-ID: <20180516183605.16159-5-josef@toxicpanda.com> (raw)
In-Reply-To: <20180516183605.16159-1-josef@toxicpanda.com>
From: Josef Bacik <jbacik@fb.com>
We need to make sure we don't just set the size of the bdev to 0 while
it's being used by a file system. We have the appropriate check in
nbd_bdev_reset, simply use that helper instead.
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
drivers/block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 24788bd10c8b..abc0a815354f 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1127,7 +1127,7 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *b
if (ret)
sock_shutdown(nbd);
mutex_lock(&nbd->config_lock);
- bd_set_size(bdev, 0);
+ nbd_bdev_reset(bdev);
/* user requested, ignore socket errors */
if (test_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags))
ret = 0;
--
2.14.3
next prev parent reply other threads:[~2018-05-16 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 18:36 [PATCH 1/5] block: fix MAINTAINERS email for nbd Josef Bacik
2018-05-16 18:36 ` [PATCH 2/5] nbd: do queue cleanup after del_gendisk Josef Bacik
2018-05-16 18:36 ` [PATCH 3/5] nbd: clear_sock on netlink disconnect Josef Bacik
2018-05-16 18:36 ` [PATCH 4/5] nbd: fix how we set bd_invalidated Josef Bacik
2018-05-16 18:36 ` Josef Bacik [this message]
2018-05-16 18:50 ` [PATCH 1/5] block: fix MAINTAINERS email for nbd Josef Bacik
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=20180516183605.16159-5-josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=axboe@kernel.dk \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=nbd@other.debian.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).