We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58ebe3e commit 5e4e1ffCopy full SHA for 5e4e1ff
arch/um/drivers/ubd_kern.c
@@ -903,6 +903,7 @@ static int ubd_add(int n, char **error_out)
903
set_capacity(disk, ubd_dev->size / 512);
904
sprintf(disk->disk_name, "ubd%c", 'a' + n);
905
disk->private_data = ubd_dev;
906
+ set_disk_ro(disk, !ubd_dev->openflags.w);
907
908
ubd_dev->pdev.id = n;
909
ubd_dev->pdev.name = DRIVER_NAME;
@@ -1159,7 +1160,6 @@ static int ubd_open(struct gendisk *disk, blk_mode_t mode)
1159
1160
}
1161
1162
ubd_dev->count++;
- set_disk_ro(disk, !ubd_dev->openflags.w);
1163
out:
1164
mutex_unlock(&ubd_mutex);
1165
return err;
0 commit comments