From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20180413160334.5496-2-josef@toxicpanda.com> References: <20180413160334.5496-1-josef@toxicpanda.com> <20180413160334.5496-2-josef@toxicpanda.com> From: Alex Gorbachev Date: Fri, 13 Apr 2018 23:02:33 -0400 Message-ID: Subject: Re: [PATCH 2/3] nbd: update size when connected To: Josef Bacik Cc: axboe@kernel.dk, nbd@other.debian.org, linux-block@vger.kernel.org, kernel-team@fb.com, Josef Bacik , stable@vger.kernel.org Content-Type: multipart/alternative; boundary="0000000000006172df0569c63832" List-ID: --0000000000006172df0569c63832 Content-Type: text/plain; charset="UTF-8" On Fri, Apr 13, 2018 at 12:03 PM, Josef Bacik wrote: > From: Josef Bacik > > I messed up changing the size of an NBD device while it was connected by > not actually updating the device or doing the uevent. Fix this by > updating everything if we're connected and we change the size. > The three patches Josef submitted today fix the problem with the online rbd-nbd expansion completely. cc: stable@vger.kernel.org > Fixes: 639812a ("nbd: don't set the device size until we're connected") > Signed-off-by: Josef Bacik Tested-by: Alex Gorbachev > --- > drivers/block/nbd.c | 2 ++ > 1 file changed, 2 insertions(+) > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c > index e33da3e6aa20..1520383b12f6 100644 > --- a/drivers/block/nbd.c > +++ b/drivers/block/nbd.c > @@ -243,6 +243,8 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize, > struct nbd_config *config = nbd->config; > config->blksize = blocksize; > config->bytesize = blocksize * nr_blocks; > + if (nbd->task_recv != NULL) > + nbd_size_update(nbd); > } > static void nbd_complete_rq(struct request *req) > -- > 2.14.3 > > --0000000000006172df0569c63832 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On F= ri, Apr 13, 2018 at 12:03 PM, Josef Bacik <josef@toxicpanda.com>= wrote:
From: J= osef Bacik <jbacik@fb.com>

I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent.=C2=A0 Fix this by
updating everything if we're connected and we change the size.

The three patches Josef submitted today fix the = problem with the online rbd-nbd expansion completely.
=C2=A0

cc: stable@vger.kernel.org
Fixes: 639812a ("nbd: don't set t= he device size until we're connected")
Signed-off-by: Josef Bacik <jbacik@fb.com>
Tested-by: Alex Gorbachev <ag@iss-integration.com>
---
<= /blockquote>=C2=A0drivers/block/nbd.c | 2 ++
=C2=A01 file changed, 2 insertions(+)

diff --git a/drivers= /block/nbd.c b/drivers/block/nbd.c
index e33da3e6aa20..1520383b12f6 100644
--- a/drivers/block/nbd.c
+= ++ b/drivers/block/nbd.c
@@ -243,6= +243,8 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksiz= e,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 str= uct nbd_config *config =3D nbd->config;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 config->blksize =3D blocksize;
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0.8ex;border-left:1px = solid rgb(204,204,204);border-right:1px solid rgb(204,204,204);padding-left= :1ex;padding-right:1ex">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 config->= ;bytesize =3D blocksize * nr_blocks;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (nbd->task_recv !=3D NULL)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0nbd_size_update(nbd);
=C2=A0}

=C2=A0static void nb= d_complete_rq(struct request *req)
--=C2=A0
2.= 14.3


--0000000000006172df0569c63832--