diff options
author | Christoph Hellwig <hch@lst.de> | 2024-02-22 08:24:15 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-27 14:21:15 -0700 |
commit | 5e4e1ff820e855a328cf2efb795c079f3a58abbe (patch) | |
tree | 822a3929b3bead94e177270bda6b2bd802669ebb /arch/um | |
parent | 58ebe3e748353960fcc3b2661273737f45d197b1 (diff) |
ubd: move set_disk_ro to ubd_add
No need to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Richard Weinberger <richard@nod.at>
Link: https://lore.kernel.org/r/20240222072417.3773131-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 26bc83063562..c5d32e754263 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -903,6 +903,7 @@ static int ubd_add(int n, char **error_out) set_capacity(disk, ubd_dev->size / 512); sprintf(disk->disk_name, "ubd%c", 'a' + n); disk->private_data = ubd_dev; + set_disk_ro(disk, !ubd_dev->openflags.w); ubd_dev->pdev.id = n; ubd_dev->pdev.name = DRIVER_NAME; @@ -1159,7 +1160,6 @@ static int ubd_open(struct gendisk *disk, blk_mode_t mode) } } ubd_dev->count++; - set_disk_ro(disk, !ubd_dev->openflags.w); out: mutex_unlock(&ubd_mutex); return err; |