Skip to content

Commit ee4bf64

Browse files
Christoph Hellwigaxboe
authored andcommitted
nbd: remove the call to set_blocksize
Block driver have no business setting the file system concept of a block size. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 449f4ec commit ee4bf64

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/block/nbd.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void nbd_size_clear(struct nbd_device *nbd)
296296
}
297297
}
298298

299-
static void nbd_size_update(struct nbd_device *nbd, bool start)
299+
static void nbd_size_update(struct nbd_device *nbd)
300300
{
301301
struct nbd_config *config = nbd->config;
302302
struct block_device *bdev = bdget_disk(nbd->disk, 0);
@@ -311,11 +311,9 @@ static void nbd_size_update(struct nbd_device *nbd, bool start)
311311
blk_queue_physical_block_size(nbd->disk->queue, config->blksize);
312312
set_capacity(nbd->disk, nr_sectors);
313313
if (bdev) {
314-
if (bdev->bd_disk) {
314+
if (bdev->bd_disk)
315315
bd_set_nr_sectors(bdev, nr_sectors);
316-
if (start)
317-
set_blocksize(bdev, config->blksize);
318-
} else
316+
else
319317
set_bit(GD_NEED_PART_SCAN, &nbd->disk->state);
320318
bdput(bdev);
321319
}
@@ -329,7 +327,7 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize,
329327
config->blksize = blocksize;
330328
config->bytesize = blocksize * nr_blocks;
331329
if (nbd->task_recv != NULL)
332-
nbd_size_update(nbd, false);
330+
nbd_size_update(nbd);
333331
}
334332

335333
static void nbd_complete_rq(struct request *req)
@@ -1309,7 +1307,7 @@ static int nbd_start_device(struct nbd_device *nbd)
13091307
args->index = i;
13101308
queue_work(nbd->recv_workq, &args->work);
13111309
}
1312-
nbd_size_update(nbd, true);
1310+
nbd_size_update(nbd);
13131311
return error;
13141312
}
13151313

0 commit comments

Comments
 (0)