From: Jon Masters <jonmasters@gmail.com>
To: Evgeny Stambulchik <Evgeny.Stambulchik@weizmann.ac.il>
Cc: linux-kernel@vger.kernel.org,
Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Subject: Re: Weirdness of "mount -o remount,rw" with write-protected floppy
Date: Sat, 29 Oct 2005 17:02:03 +0100 [thread overview]
Message-ID: <35fb2e590510290902y2152f703t56d0cc688f3c64cb@mail.gmail.com> (raw)
In-Reply-To: <4360C0A7.4050708@weizmann.ac.il>
On 10/27/05, Evgeny Stambulchik <Evgeny.Stambulchik@weizmann.ac.il> wrote:
> # mount /dev/fd0 /mnt/floppy/
> mount: block device /dev/fd0 is write-protected, mounting read-only
> # mount -o remount,rw /mnt/floppy
> # echo $?
> 0
Ok. The problem is in the remounting. Both cases rely on the mount
syscall doing the work and the "fault" is that it is returning
successfully in both cases.
When remounting, Linux /does/ check if the corresponding block device
is read-only and won't remount rw onto that (so if the permissions of
the bdev corresponded to the real state of the floppy then all would
be good) but it will if the block dev is writeable but the device is
not. There isn't a generic VFS way to ask if a backing device is
writeable (or do_remount_sb would be using it) - or is there?
The /only/ way I can see to "fix" this is to do a pointless open on
the block device and see if that returns EROFS before allowing a
remount. But I don't know what other hassle that will cause - I'll
make the hack, but someone (Al?) who knows the code will need to
comment because this might completely fuck up a lock somewhere.
Jon.
next prev parent reply other threads:[~2005-10-29 16:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-27 11:57 Evgeny Stambulchik
2005-10-27 15:05 ` Jon Masters
2005-10-29 11:58 ` Jon Masters
2005-10-29 13:10 ` Jon Masters
2005-10-27 21:09 ` Rob Landley
2005-10-28 11:55 ` Evgeny Stambulchik
2005-10-28 12:26 ` Rob Landley
2005-10-28 13:15 ` Evgeny Stambulchik
2005-10-28 13:50 ` Rob Landley
2005-10-28 14:52 ` Evgeny Stambulchik
2005-10-29 1:29 ` Rob Landley
2005-10-29 11:06 ` Evgeny Stambulchik
2005-10-29 16:02 ` Jon Masters [this message]
2005-10-29 17:05 ` Jon Masters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35fb2e590510290902y2152f703t56d0cc688f3c64cb@mail.gmail.com \
--to=jonmasters@gmail.com \
--cc=Evgeny.Stambulchik@weizmann.ac.il \
--cc=jonathan@jonmasters.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®