public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Q. block: check bdev_read_only() from blkdev_get()
@ 2011-01-21 13:19 J. R. Okajima
  2011-01-21 13:28 ` Tejun Heo
  2011-01-22 14:22 ` [PATCH 1/2] loop: guarantee lo->lo_device availability while fd is bound Tejun Heo
  0 siblings, 2 replies; 7+ messages in thread
From: J. R. Okajima @ 2011-01-21 13:19 UTC (permalink / raw)
  To: Tejun Heo; +Cc: David Brownell, linux-usb, linux-kernel


By the commit 75f1dc0
	2010-11-13 block: check bdev_read_only() from blkdev_get()
bdev_read_only() call is added into blkdev_get().

This check makes the loopback block device unable to be mounted as
writable once it is set to readonly, even if the corresponding is
detached and the device becomes free.
We may need to re-initialize the readonly/writable status flag somewhere?

# simple tests with loopback

# mount as writable, succeed
+ sudo mount -o loop ./ext2.img /mnt
+ sudo umount /mnt

# mount as readonly, succeed
+ sudo mount -o ro,loop ./ext2.img /mnt
+ sudo umount /mnt

# mount as writable again, fail
+ sudo mount -o loop ./ext2.img /mnt
/dev/loop0: Permission denied

Now /dev/loop0 is fixed as readonly.


J. R. Okajima

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-24  1:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21 13:19 Q. block: check bdev_read_only() from blkdev_get() J. R. Okajima
2011-01-21 13:28 ` Tejun Heo
2011-01-22  8:32   ` J. R. Okajima
2011-01-22 11:48     ` Tejun Heo
2011-01-22 14:22 ` [PATCH 1/2] loop: guarantee lo->lo_device availability while fd is bound Tejun Heo
2011-01-22 14:23   ` [PATCH 2/2] block: clear ro on fd detach " Tejun Heo
2011-01-24  1:28     ` J. R. Okajima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox