From: Jan Kara <jack@suse.cz>
To: tytso@mit.edu
Cc: "Andreas Dilger" <adilger@dilger.ca>,
"Daeho Jeong" <daeho.jeong@samsung.com>,
jack@suse.cz,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
이기태 <kitae87.lee@samsung.com>
Subject: Re: [PATCH] ext4: guarantee already started handles to successfully finish while ro remounting
Date: Mon, 9 May 2016 10:40:49 +0200 [thread overview]
Message-ID: <20160509084049.GD11897@quack2.suse.cz> (raw)
In-Reply-To: <20160506233623.GD7303@thunk.org>
On Fri 06-05-16 23:36:23, Ted Tso wrote:
> On Fri, May 06, 2016 at 02:01:17PM -0600, Andreas Dilger wrote:
> >
> > The problem is that emergency remount-ro doesn't block in-progress writes,
> > since most operations only check the MS_RDONLY at the start of an operation.
> > It would be possible for do_emergency_remount() call ->freeze_fs() first for
> > all the filesystems, then doing the remount read-only (would need a change to
> > do_remount_ro() to allow this)?
>
> I thought about doing that, but that would mean that the code path
> might need to take some locks along the way, and if you have multiple
> file systems, for which one has wedged, the do_emergency_remount()
> function might end up blocking when it tries calling freeze_fs() on
> one of the file system before it managed to get to the rest of the
> file systems in the system.
>
> This really goes to the question of what is do_emergency_remount()
> for. If the goal is to minimize damage, then you want to keep things
> as simple as possible, and to not allow any emergency remounts for any
> file system to block.
>
> If the goal is to allow the normal shutdown path to use this because
> the userspace code is too lazy to do a proper shutdown of all user
> processes, and too lazy to go through all of the mounted file systems
> and individually call FIFREEZE, then sure, we could iterate over the
> file systems and call freeze_fs() in kernel code. But I'm not really
> sure I see the point......
>
> > That ensures the filesystem is in a (more) consistent state when force
> > remount-ro is called (i.e. which doesn't block or return an error if there
> > are writers on the filesystem).
>
> Right, but if the kernel is calling freeze_fs(), freeze_fs() might
> block, and then what would we do?
Yeah, 100% agreed. Emergency remount is for the case where the system is
too hosed to allow for normal shutdown (e.g. kernel has oopsed while
holding fs locks so normal unmount attempt will just block) and you want to
limit fs damage. So emergency remount should not block and thus it cannot
wait for any outstanding writes.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2016-05-09 8:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 6:01 [PATCH] ext4: guarantee already started handles to successfully finish while ro remounting Daeho Jeong
2016-05-06 13:00 ` Theodore Ts'o
2016-05-06 20:01 ` Andreas Dilger
2016-05-06 23:36 ` tytso
2016-05-09 8:40 ` Jan Kara [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-05-07 13:05 Daeho Jeong
2016-05-07 17:47 ` Theodore Ts'o
2016-05-06 5:35 Daeho Jeong
2016-05-02 0:50 Daeho Jeong
2016-05-05 13:45 ` Jan Kara
2016-05-05 15:44 ` Theodore Ts'o
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=20160509084049.GD11897@quack2.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=daeho.jeong@samsung.com \
--cc=kitae87.lee@samsung.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).