All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 5/7] ext4: pass -ESHUTDOWN code to jbd2 layer
Date: Thu, 17 May 2018 17:18:18 +0200	[thread overview]
Message-ID: <20180517151818.chnwazjmyh4n24rb@quack2.suse.cz> (raw)
In-Reply-To: <20180322152644.GE2852@thunk.org>

On Thu 22-03-18 11:26:45, Theodore Y. Ts'o wrote:
> On Tue, Mar 06, 2018 at 06:10:41PM +0100, Jan Kara wrote:
> > Is it really correct that once the filesystem gets shutdown you clear the
> > previous error from the journal? Because if we hit some real fs corruption,
> > the journal gets aborted, and then someone calls ext4_shutdown(), we'd
> > clear that error which looks like a bug to me because that shutdown hardly
> > fixes the fs corruption...
> 
> That's not what the code does.  If journal->j_errno is set, then we
> won't clear it, for precisely what concern you've articulated.

Sorry for not following up on this earlier but now I've returned to this
and I still cannot wrap my head around checks in __journal_abort_soft().
There's:

       if (!journal->j_errno || errno == -ESHUTDOWN)
               journal->j_errno = errno;

Due to this ESHUTDOWN will override anything in journal->j_errno. Why is
that?

And then:

       if (journal->j_flags & JBD2_ABORT) {
                write_unlock(&journal->j_state_lock);
                if (!old_errno && old_errno != -ESHUTDOWN &&
                    errno == -ESHUTDOWN)
                        jbd2_journal_update_sb_errno(journal);

And here can the test ever be true? Probably only if we hard-aborted the
journal. The test !old_errno && old_errno != -ESHUTDOWN definitely looks
weird and is equivalent to old_errno == 0. Furthermore the errno ==
-ESHUTDOWN part looks strange as well as in that case we'd only clear the
sb->s_errno field... So what was really the intention here?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2018-05-17 15:18 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
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 [this message]
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=20180517151818.chnwazjmyh4n24rb@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.