]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: don't set the device size until we're connected
authorJosef Bacik <jbacik@fb.com>
Mon, 9 Oct 2017 17:12:10 +0000 (13:12 -0400)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 18:29:22 +0000 (12:29 -0600)
commitb8d12a8bed7888b009d95f03aeef7c9948a8b7a3
tree8159e04a521c4345eea2d6d47be9e2995d0b8f62
parent5cca10b5c212d025db146f11dbffa4deb48f823f
nbd: don't set the device size until we're connected

A user reported a regression with using the normal ioctl interface on
newer kernels.  This happens because I was setting the device size
before the device was actually connected, which caused us to error out
and close everything down.  This didn't happen on netlink because we
hold the device lock the whole time we're setting things up, but we
don't do that for the ioctl path.  This fixes the problem.

Cc: stable@vger.kernel.org
Fixes: 78a54ba ("nbd: stop using the bdev everywhere")
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c