The patch titled Subject: nbd: show read-only state in sysfs has been added to the -mm tree. Its filename is nbd-show-read-only-state-in-sysfs.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Paolo Bonzini <pbonzini@xxxxxxxxxx> Subject: nbd: show read-only state in sysfs Pass the read-only flag to set_device_ro, so that it will be visible to the block layer and in sysfs. Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> Cc: Paul Clements <Paul.Clements@xxxxxxxxxxxx> Cc: Alex Bligh <alex@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/block/nbd.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN drivers/block/nbd.c~nbd-show-read-only-state-in-sysfs drivers/block/nbd.c --- a/drivers/block/nbd.c~nbd-show-read-only-state-in-sysfs +++ a/drivers/block/nbd.c @@ -703,6 +703,8 @@ static int __nbd_ioctl(struct block_devi mutex_unlock(&nbd->tx_lock); + if (nbd->flags & NBD_FLAG_READ_ONLY) + set_device_ro(bdev, true); if (nbd->flags & NBD_FLAG_SEND_TRIM) queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); @@ -730,6 +732,7 @@ static int __nbd_ioctl(struct block_devi dev_warn(disk_to_dev(nbd->disk), "queue cleared\n"); kill_bdev(bdev); queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); + set_device_ro(bdev, false); if (file) fput(file); nbd->flags = 0; _ Patches currently in -mm which might be from pbonzini@xxxxxxxxxx are linux-next.patch nbd-support-flush-requests.patch nbd-fsync-and-kill-block-device-on-shutdown.patch nbd-show-read-only-state-in-sysfs.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html