udf: Refuse RW mount of the filesystem instead of making it RO
authorJan Kara <jack@suse.cz>
Thu, 25 Jul 2013 14:15:16 +0000 (16:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2013 16:41:01 +0000 (09:41 -0700)
commite3bbf180fae3a912252247df288665b0ebdb9c50
tree78861b9aa8c5cec2ba1cf8fd19bdf64dcf4bd117
parente1891c4845a169722145155688da639a44d2969f
udf: Refuse RW mount of the filesystem instead of making it RO

commit e729eac6f65e11c5f03b09adcc84bd5bcb230467 upstream.

Refuse RW mount of udf filesystem. So far we just silently changed it
to RO mount but when the media is writeable, block layer won't notice
this change and thus will think device is used RW and will block eject
button of the drive. That is unexpected by users because for
non-writeable media eject button works just fine.

Userspace mount(8) command handles this just fine and retries mounting
with MS_RDONLY set so userspace shouldn't see any regression.  Plus any
tool mounting udf is likely confronted with the case of read-only
media where block layer already refuses to mount the filesystem without
MS_RDONLY set so our behavior shouldn't be anything new for it.

Reported-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/super.c