On Thu 25-07-13 11:33:35, Tejun Heo wrote: > Hello, Jan. > > On Thu, Jul 25, 2013 at 12:03:58PM +0200, Jan Kara wrote: > > When we are asked to RW mount in case filesystem cannot really do RW, we > > return -EROFS instead of silently falling back to RO mount. Userspace > > mount(8) command will try again with MS_RDONLY set so things should still > > work OK and the problems with eject button would be solved. I'll try to > > code that up. > > Hmmm.... while it is neat, it is very visible to userland and I'm a > bit concerned that we might break some obscure tool which isn't using > the standard mount. Not sure about udf but for iso9660, which is > vastly more common anyway, just always setting MS_RDONLY seems like > the better solution. Well, the trick is that if the media is not writeable, mount without MS_RDONLY will fail even currently (tried that in practice, also see the check in blkdev_get_by_path()). So such tool should handle that case even currently. The only somewhat realistic case I'm aware of is if someone uses UDF on e.g. USB stick, it is created so that Linux doesn't support writing to it, and then some tool would be mounting it directly via syscall and would not handle the read-only media case right. But I don't find this likely so I think it would be worth trying out this approach before we try playing tricks with dropping write access... Hmm? Honza -- Jan Kara <jack@xxxxxxx> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html