From: Vegard Nossum <vegard.nossum@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] ext4: don't call ext4_should_journal_data() on the journal inode
Date: Sun, 3 Jul 2016 09:05:05 +0200 [thread overview]
Message-ID: <5778B921.9060603@oracle.com> (raw)
In-Reply-To: <20160703051505.GA17739@thunk.org>
On 07/03/2016 07:15 AM, Theodore Ts'o wrote:
> On Sat, Jul 02, 2016 at 11:42:42PM +0200, Vegard Nossum wrote:
>> Certain combinations of mount options in the superblock will cause
>> set_journal_csum_feature_set() in ext4_fill_super() to fail after the
>> journal has been created. When iput() is called on the journal inode,
>> we will hit the BUG() in ext4_should_journal_data(). We can prevent
>> this by only calling ext4_should_journal_data() if we already know
>> that it's not the journal inode.
>
> Which mount options? Can you please give a reproducer?
Unfortunately I can't share the reproducer, but...
s->mount_opt = 0xa882c020, which seems like it is:
EXT4_MOUNT_ERRORS_RO
EXT4_MOUNT_XATTR_USER
EXT4_MOUNT_POSIX_ACL
EXT4_MOUNT_BARRIER
EXT4_MOUNT_JOURNAL_CHECKSUM
EXT4_MOUNT_DELALLOC
EXT4_MOUNT_BLOCK_VALIDITY
EXT4_MOUNT_INIT_INODE_TABLE
At mount time, this ends up calling
jbd2_journal_clear_features(JBD2_FEATURE_COMPAT_CHECKSUM, 0,
JBD2_FEATURE_INCOMPAT_CSUM_V3 | JBD2_FEATURE_INCOMPAT_CSUM_V2)
jbd2_journal_set_features(0, 0, JBD2_FEATURE_INCOMPAT_CSUM_V3) = 0 // fails
jbd2_journal_clear_features(0x0, 0x0, JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)
The reason the set_features() call ends up calling is because
journal->j_format_version == 1.
Maybe the "mount options" thing was a bit misleading and we should
rather say "Certain combinations of mount options
(EXT4_MOUNT_JOURNAL_CHECKSUM), journal format (v1), and superblock
features (EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) [...]" in the changelog.
Does that make more sense?
Hope this helps,
Vegard
next prev parent reply other threads:[~2016-07-03 7:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-02 21:42 [PATCH] ext4: don't call ext4_should_journal_data() on the journal inode Vegard Nossum
2016-07-03 5:15 ` Theodore Ts'o
2016-07-03 7:05 ` Vegard Nossum [this message]
2016-07-04 15:02 ` Theodore Ts'o
2016-07-04 8:08 ` Jan Kara
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=5778B921.9060603@oracle.com \
--to=vegard.nossum@oracle.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@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.