[Devel] [PATCH RHEL7 COMMIT] ms/nbd: update size when connected

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 5 11:06:18 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-1062.4.1.vz7.115.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.4.1.vz7.115.7
------>
commit dbaa3db4d9ff578c11668758462cebf2cc8efb1b
Author: Josef Bacik <jbacik at fb.com>
Date:   Tue Nov 5 11:06:16 2019 +0300

    ms/nbd: update size when connected
    
    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.
    
    cc: stable at vger.kernel.org
    Fixes: 639812a ("nbd: don't set the device size until we're connected")
    Signed-off-by: Josef Bacik <jbacik at fb.com>
    Signed-off-by: Jens Axboe <axboe at kernel.dk>
    
    https://jira.sw.ru/browse/PSBM-99102
    (cherry picked from commit c3f7c9397609705ef848cc98a5fb429b3e90c3c4)
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 drivers/block/nbd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index ea5880077933..a0ebd61c19d8 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -208,6 +208,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_end_request(struct nbd_cmd *cmd)



More information about the Devel mailing list