stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 3/7] ext4: shutdown should not prevent get_write_access
Date: Thu, 22 Mar 2018 11:38:12 -0400	[thread overview]
Message-ID: <20180322153811.GG2852@thunk.org> (raw)
In-Reply-To: <20180307094201.ihki3mh7lnib4ta4@quack2.suse.cz>

On Wed, Mar 07, 2018 at 10:42:01AM +0100, Jan Kara wrote:
> On Mon 19-02-18 21:30:34, Theodore Ts'o wrote:
> > The ext4 forced shutdown flag needs to prevent new handles from being
> > started, but it needs to allow existing handles to complete.  So the
> > forced shutdown flag should not force ext4_journal_get_write_access to
> > fail.
> > 
> > Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> > Cc: stable@vger.kernel.org
> 
> OK, if you want the semantics of ext4 shutdown to be that running
> handles should be allowed to complete, I see where you are going with this
> patch. However there are more problems with this semantics than just
> __ext4_journal_get_write_access(). Just for example
> ext4_reserve_inode_write() will bail in case the fs got shutdown and thus
> inode changes won't be properly added to the running handle. Also places
> that rely on nested transactions being possible will not work because
> ext4_journal_start_sb() will refuse to get refcount of a running handle
> (ext4_journal_check_start() fails) in case fs got shutdown. And I may have
> missed other cases.

We have three cases in ext4_shutdown:

EXT4_GOING_FLAGS_DEFUALT:
    Freezes the block device, sets the EXT4_FLAGS_SHUTDOWN flag, and then
    unfreezes the block device:

EXT4_GOING_FLAGS_LOGFLUSH:
    Sets the EXT4_FLAGS_SHUTDOWN flag, forces a commit, and then aborts
    the journal.

EXT4_GOING_FLAGS_NOLOGFLUSH
    Sets the EXT4_FLAGS_SHUTDOWN flag, aborts the journal.

> The above problems are a reason why I though the semantics of ext4 shutdown
> was terminate the fs *now* - effectively a software equivalent of power
> off. That is much easier to implement since we just have to make sure no
> running handle makes it to the journal... Since I've said Google is using
> ext4 shutdown - is there any reason why you need the "running handles are
> allowed to finish" semantics? After all it seems it's just a race whether
> some handle makes it before the cut off or not...

Good points.  I'll have to look at what happens if we just drop the
EXT4_FLAGS_SHUTDOWN flag altogether.

							- Ted

  reply	other threads:[~2018-03-22 15:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180220023038.19883-1-tytso@mit.edu>
2018-02-20  2:30 ` [PATCH 3/7] ext4: shutdown should not prevent get_write_access Theodore Ts'o
2018-03-07  9:42   ` Jan Kara
2018-03-22 15:38     ` Theodore Y. Ts'o [this message]
2018-02-20  2:30 ` [PATCH 4/7] ext4: eliminate sleep from shutdown ioctl Theodore Ts'o
2018-03-07  9:07   ` Jan Kara
2018-02-20  2:30 ` [PATCH 5/7] ext4: pass -ESHUTDOWN code to jbd2 layer Theodore Ts'o
2018-03-06 17:10   ` Jan Kara
2018-03-22 15:26     ` Theodore Y. Ts'o
2018-05-17 15:18       ` Jan Kara
2018-02-20  2:30 ` [PATCH 6/7] jbd2: if the journal is aborted then don't allow update of the log tail Theodore Ts'o
2018-03-07  8:55   ` Jan Kara
2018-02-20  2:30 ` [PATCH 7/7] ext4: don't update checksum of new initialized bitmaps Theodore Ts'o
2018-03-07  9:06   ` Jan Kara
2018-03-22 15:29     ` Theodore Y. 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=20180322153811.GG2852@thunk.org \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=stable@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).