Re: [PATCH] ext4: don't call ext4_should_journal_data() on the journal inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux