From: Theodore Tso <tytso@mit.edu>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Christoph Hellwig <hch@lst.de>,
akpm@osdl.org, haveblue@us.ibm.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH[RFC] kill sysrq-u (emergency remount r/o)
Date: Mon, 5 Feb 2007 22:17:44 -0500 [thread overview]
Message-ID: <20070206031744.GA11018@thunk.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0702052136310.19384@yvahk01.tjqt.qr>
On Mon, Feb 05, 2007 at 09:40:08PM +0100, Jan Engelhardt wrote:
>
> On Feb 5 2007 18:32, Christoph Hellwig wrote:
> >
> >in two recent discussions (file_list_lock scalability and remount r/o
> >on suspend) I stumbled over this emergency remount feature. It's not
> >actually useful because it tries a potentially dangerous remount
> >despite writers still beeing in progress, which we can't get rid.
>
> The current way is to remount things, and return -EROFS to any process
> that attempts to write(). Unless we want to kill processes to get rid of
> them [most likely we possibly won't], I am fine with how things are atm.
> So, what's the "dangerous" part, actually?
The dangerous part is that we change f->f_mode for all open files
without regard for whether there might be any writes underway at the
time. This isn't *serious* although the results might be a little
strange and it might result in a confused return from write(2). More
seriously, mark_files_ro() in super.c *only* changes f->f_mode and
doesn't deal with the possibility that the file might be mapped
read-write. For filesystems that do delayed allocation, I'm not at
all convinced that an emergency read-only will result in the
filesystem doing anything at all sane, depending on what else the
filesystem might do when the filesystem is forced into read-only state.
> sysrq+u is helpful. It is like \( sysrq+s && make sure no further writes
> go to disk \).
I agree it is useful, but if we're going to do it we really should do
it right. We should have real revoke() functionality on file
descriptors, which revokes all of the mmap()'s (any attempt to write
into a previously read/write mmap will cause a SEGV) as well as
changing f_mode, and then use that to implement emergency read-only
remount.
- Ted
next prev parent reply other threads:[~2007-02-06 5:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 17:32 [PATCH[RFC] kill sysrq-u (emergency remount r/o) Christoph Hellwig
2007-02-05 17:34 ` [PATCH[RFC] don't force remount in " Christoph Hellwig
2007-02-05 20:40 ` [PATCH[RFC] kill " Jan Engelhardt
2007-02-06 3:17 ` Theodore Tso [this message]
2007-02-06 9:44 ` Christoph Hellwig
2007-02-06 0:15 ` Eric W. Biederman
2007-02-06 0:45 ` Nigel Cunningham
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=20070206031744.GA11018@thunk.org \
--to=tytso@mit.edu \
--cc=akpm@osdl.org \
--cc=haveblue@us.ibm.com \
--cc=hch@lst.de \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).