* [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
@ 2018-12-11 6:17 medadyoung
2018-12-13 14:21 ` Adriana Kobylak
0 siblings, 1 reply; 8+ messages in thread
From: medadyoung @ 2018-12-11 6:17 UTC (permalink / raw)
To: jbacik, axboe; +Cc: linux-block, nbd, linux-kernel, openbmc, Medad
From: Medad <medadyoung@gmail.com>
If we do NOT clear NBD_BOUND flag when NBD connection is closed,
then the original NBD device could not be used again.
Signed-off-by: Medad <medadyoung@gmail.com>
---
drivers/block/nbd.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 64278f4..5c88490 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -277,10 +277,14 @@ static void sock_shutdown(struct nbd_device *nbd)
struct nbd_config *config = nbd->config;
int i;
- if (config->num_connections == 0)
+ if (config->num_connections == 0) {
+ clear_bit(NBD_BOUND, &config->runtime_flags);
return;
- if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags))
+ }
+ if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags)) {
+ clear_bit(NBD_BOUND, &config->runtime_flags);
return;
+ }
for (i = 0; i < config->num_connections; i++) {
struct nbd_sock *nsock = config->socks[i];
@@ -944,7 +948,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
sockfd_put(old);
clear_bit(NBD_DISCONNECTED, &config->runtime_flags);
-
+ clear_bit(NBD_BOUND, &config->runtime_flags);
/* We take the tx_mutex in an error path in the recv_work, so we
* need to queue_work outside of the tx_mutex.
*/
@@ -1020,6 +1024,7 @@ static int nbd_disconnect(struct nbd_device *nbd)
dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n");
set_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags);
send_disconnects(nbd);
+ clear_bit(NBD_BOUND, &config->runtime_flags);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2018-12-11 6:17 [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed medadyoung
@ 2018-12-13 14:21 ` Adriana Kobylak
2019-01-18 15:44 ` Adriana Kobylak
2019-04-03 17:13 ` Adriana Kobylak
0 siblings, 2 replies; 8+ messages in thread
From: Adriana Kobylak @ 2018-12-13 14:21 UTC (permalink / raw)
To: medadyoung, joel, jk
Cc: jbacik, axboe, linux-block, openbmc, linux-kernel, nbd, openbmc
On 2018-12-11 00:17, medadyoung@gmail.com wrote:
> From: Medad <medadyoung@gmail.com>
>
> If we do NOT clear NBD_BOUND flag when NBD connection is closed,
> then the original NBD device could not be used again.
>
> Signed-off-by: Medad <medadyoung@gmail.com>
Tested on Witherspoon (OpenPOWER P9 with AST2500) and verified with
this patch that the NBD device could be disconnected/reconnected.
Tested by: Adriana Kobylak <anoo@linux.ibm.com>
> ---
> drivers/block/nbd.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 64278f4..5c88490 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -277,10 +277,14 @@ static void sock_shutdown(struct nbd_device *nbd)
> struct nbd_config *config = nbd->config;
> int i;
>
> - if (config->num_connections == 0)
> + if (config->num_connections == 0) {
> + clear_bit(NBD_BOUND, &config->runtime_flags);
> return;
> - if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags))
> + }
> + if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags)) {
> + clear_bit(NBD_BOUND, &config->runtime_flags);
> return;
> + }
>
> for (i = 0; i < config->num_connections; i++) {
> struct nbd_sock *nsock = config->socks[i];
> @@ -944,7 +948,7 @@ static int nbd_reconnect_socket(struct nbd_device
> *nbd, unsigned long arg)
> sockfd_put(old);
>
> clear_bit(NBD_DISCONNECTED, &config->runtime_flags);
> -
> + clear_bit(NBD_BOUND, &config->runtime_flags);
> /* We take the tx_mutex in an error path in the recv_work, so we
> * need to queue_work outside of the tx_mutex.
> */
> @@ -1020,6 +1024,7 @@ static int nbd_disconnect(struct nbd_device *nbd)
> dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n");
> set_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags);
> send_disconnects(nbd);
> + clear_bit(NBD_BOUND, &config->runtime_flags);
> return 0;
> }
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2018-12-13 14:21 ` Adriana Kobylak
@ 2019-01-18 15:44 ` Adriana Kobylak
2019-01-21 1:43 ` Joel Stanley
2019-04-03 17:13 ` Adriana Kobylak
1 sibling, 1 reply; 8+ messages in thread
From: Adriana Kobylak @ 2019-01-18 15:44 UTC (permalink / raw)
To: joel, jk; +Cc: openbmc, medadyoung
Hi Joel,
Why has this patch been archived and marked as "Not Applicable"? -
http://patchwork.ozlabs.org/patch/1011480/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2019-01-18 15:44 ` Adriana Kobylak
@ 2019-01-21 1:43 ` Joel Stanley
0 siblings, 0 replies; 8+ messages in thread
From: Joel Stanley @ 2019-01-21 1:43 UTC (permalink / raw)
To: Adriana Kobylak; +Cc: Jeremy Kerr, OpenBMC Maillist, medadyoung
On Sat, 19 Jan 2019 at 02:38, Adriana Kobylak <anoo@linux.ibm.com> wrote:
>
> Hi Joel,
>
> Why has this patch been archived and marked as "Not Applicable"? -
This is a patch for the upstream kernel, not openbmc.
OpenBMC patches follow this process and contain the target branch they
want the maintainer to apply them to:
https://github.com/openbmc/linux/wiki/DevelopmentProcess#patch-submitters-wishing-to-have-a-change-included-through-this-process
If you want this backported to the openbmc kernel I suggest you follow
this process.
(I notice that this patch has not been accepted upstream. I suggest
you follow up on the upstream list before asking it to be submitted).
Cheers,
Joel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2018-12-13 14:21 ` Adriana Kobylak
2019-01-18 15:44 ` Adriana Kobylak
@ 2019-04-03 17:13 ` Adriana Kobylak
2019-04-03 17:49 ` Josef Bacik
1 sibling, 1 reply; 8+ messages in thread
From: Adriana Kobylak @ 2019-04-03 17:13 UTC (permalink / raw)
To: josef, axboe; +Cc: medadyoung, openbmc, nbd, linux-block
Adding Josef (updated email address in the maintainers file).
On 2018-12-13 08:21, Adriana Kobylak wrote:
> On 2018-12-11 00:17, medadyoung@gmail.com wrote:
>> From: Medad <medadyoung@gmail.com>
>>
>> If we do NOT clear NBD_BOUND flag when NBD connection is closed,
>> then the original NBD device could not be used again.
>>
>> Signed-off-by: Medad <medadyoung@gmail.com>
>
> Tested on Witherspoon (OpenPOWER P9 with AST2500) and verified with
> this patch that the NBD device could be disconnected/reconnected.
>
> Tested by: Adriana Kobylak <anoo@linux.ibm.com>
>
>> ---
>> drivers/block/nbd.c | 11 ++++++++---
>> 1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
>> index 64278f4..5c88490 100644
>> --- a/drivers/block/nbd.c
>> +++ b/drivers/block/nbd.c
>> @@ -277,10 +277,14 @@ static void sock_shutdown(struct nbd_device
>> *nbd)
>> struct nbd_config *config = nbd->config;
>> int i;
>>
>> - if (config->num_connections == 0)
>> + if (config->num_connections == 0) {
>> + clear_bit(NBD_BOUND, &config->runtime_flags);
>> return;
>> - if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags))
>> + }
>> + if (test_and_set_bit(NBD_DISCONNECTED, &config->runtime_flags)) {
>> + clear_bit(NBD_BOUND, &config->runtime_flags);
>> return;
>> + }
>>
>> for (i = 0; i < config->num_connections; i++) {
>> struct nbd_sock *nsock = config->socks[i];
>> @@ -944,7 +948,7 @@ static int nbd_reconnect_socket(struct nbd_device
>> *nbd, unsigned long arg)
>> sockfd_put(old);
>>
>> clear_bit(NBD_DISCONNECTED, &config->runtime_flags);
>> -
>> + clear_bit(NBD_BOUND, &config->runtime_flags);
>> /* We take the tx_mutex in an error path in the recv_work, so we
>> * need to queue_work outside of the tx_mutex.
>> */
>> @@ -1020,6 +1024,7 @@ static int nbd_disconnect(struct nbd_device
>> *nbd)
>> dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n");
>> set_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags);
>> send_disconnects(nbd);
>> + clear_bit(NBD_BOUND, &config->runtime_flags);
>> return 0;
>> }
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2019-04-03 17:13 ` Adriana Kobylak
@ 2019-04-03 17:49 ` Josef Bacik
0 siblings, 0 replies; 8+ messages in thread
From: Josef Bacik @ 2019-04-03 17:49 UTC (permalink / raw)
To: Adriana Kobylak; +Cc: josef, axboe, medadyoung, openbmc, nbd, linux-block
On Wed, Apr 03, 2019 at 12:13:53PM -0500, Adriana Kobylak wrote:
> Adding Josef (updated email address in the maintainers file).
>
> On 2018-12-13 08:21, Adriana Kobylak wrote:
> > On 2018-12-11 00:17, medadyoung@gmail.com wrote:
> > > From: Medad <medadyoung@gmail.com>
> > >
> > > If we do NOT clear NBD_BOUND flag when NBD connection is closed,
> > > then the original NBD device could not be used again.
> > >
> > > Signed-off-by: Medad <medadyoung@gmail.com>
This doesn't sound right, this is just making sure we don't use the IOCTL
configuration stuff with the netlink stuff. Once the disconnect happens the
configuration should go away and it doesn't matter anymore. What are you doing
to reproduce this problem? Thanks,
Josef
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
@ 2019-04-03 17:49 ` Josef Bacik
0 siblings, 0 replies; 8+ messages in thread
From: Josef Bacik @ 2019-04-03 17:49 UTC (permalink / raw)
To: Adriana Kobylak; +Cc: josef, axboe, medadyoung, openbmc, nbd, linux-block
On Wed, Apr 03, 2019 at 12:13:53PM -0500, Adriana Kobylak wrote:
> Adding Josef (updated email address in the maintainers file).
>
> On 2018-12-13 08:21, Adriana Kobylak wrote:
> > On 2018-12-11 00:17, medadyoung@gmail.com wrote:
> > > From: Medad <medadyoung@gmail.com>
> > >
> > > If we do NOT clear NBD_BOUND flag when NBD connection is closed,
> > > then the original NBD device could not be used again.
> > >
> > > Signed-off-by: Medad <medadyoung@gmail.com>
This doesn't sound right, this is just making sure we don't use the IOCTL
configuration stuff with the netlink stuff. Once the disconnect happens the
configuration should go away and it doesn't matter anymore. What are you doing
to reproduce this problem? Thanks,
Josef
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed
2019-04-03 17:49 ` Josef Bacik
(?)
@ 2019-04-04 15:31 ` Adriana Kobylak
-1 siblings, 0 replies; 8+ messages in thread
From: Adriana Kobylak @ 2019-04-04 15:31 UTC (permalink / raw)
To: Josef Bacik; +Cc: axboe, medadyoung, openbmc, nbd, linux-block
On 2019-04-03 12:49, Josef Bacik wrote:
> On Wed, Apr 03, 2019 at 12:13:53PM -0500, Adriana Kobylak wrote:
>> Adding Josef (updated email address in the maintainers file).
>>
>> On 2018-12-13 08:21, Adriana Kobylak wrote:
>> > On 2018-12-11 00:17, medadyoung@gmail.com wrote:
>> > > From: Medad <medadyoung@gmail.com>
>> > >
>> > > If we do NOT clear NBD_BOUND flag when NBD connection is closed,
>> > > then the original NBD device could not be used again.
>> > >
>> > > Signed-off-by: Medad <medadyoung@gmail.com>
>
> This doesn't sound right, this is just making sure we don't use the
> IOCTL
> configuration stuff with the netlink stuff. Once the disconnect
> happens the
> configuration should go away and it doesn't matter anymore. What are
> you doing
> to reproduce this problem? Thanks,
>
> Josef
I'm not seeing an issue now that we've moved to a new version of Yocto
containing
NBD 3.17. For reference we were reproducing by setting up a virtual
media device
on a BMC (https://github.com/openbmc/jsnbd).
We can close this patch request unless Medad still sees an issue in his
environment.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-04-04 15:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 6:17 [PATCH] nbd:clear NBD_BOUND flag when NBD connection is closed medadyoung
2018-12-13 14:21 ` Adriana Kobylak
2019-01-18 15:44 ` Adriana Kobylak
2019-01-21 1:43 ` Joel Stanley
2019-04-03 17:13 ` Adriana Kobylak
2019-04-03 17:49 ` Josef Bacik
2019-04-03 17:49 ` Josef Bacik
2019-04-04 15:31 ` Adriana Kobylak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.