Ritesh Harjani
8c472abaed
ext4: check for non-zero journal inum in ext4_calculate_overhead
...
commit f1eec3b0d0a849996ebee733b053efa71803dad5 upstream.
While calculating overhead for internal journal, also check
that j_inum shouldn't be 0. Otherwise we get below error with
xfstests generic/050 with external journal (XXX_LOGDEV config) enabled.
It could be simply reproduced with loop device with an external journal
and marking blockdev as RO before mounting.
[ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0 : comm mount: iget: illegal inode #
------------[ cut here ]------------
generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2)
WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0
CPU: 107 PID: 115347 Comm: mount Tainted: G L --------- -t - 4.18.0-167.el8.ppc64le #1
NIP: c0000000006f6d44 LR: c0000000006f6d40 CTR: 0000000030041dd4
<...>
NIP [c0000000006f6d44] generic_make_request_checks+0x6b4/0x7d0
LR [c0000000006f6d40] generic_make_request_checks+0x6b0/0x7d0
<...>
Call Trace:
generic_make_request_checks+0x6b0/0x7d0 (unreliable)
generic_make_request+0x3c/0x420
submit_bio+0xd8/0x200
submit_bh_wbc+0x1e8/0x250
__sync_dirty_buffer+0xd0/0x210
ext4_commit_super+0x310/0x420 [ext4]
__ext4_error+0xa4/0x1e0 [ext4]
__ext4_iget+0x388/0xe10 [ext4]
ext4_get_journal_inode+0x40/0x150 [ext4]
ext4_calculate_overhead+0x5a8/0x610 [ext4]
ext4_fill_super+0x3188/0x3260 [ext4]
mount_bdev+0x778/0x8f0
ext4_mount+0x28/0x50 [ext4]
mount_fs+0x74/0x230
vfs_kern_mount.part.6+0x6c/0x250
do_mount+0x2fc/0x1280
sys_mount+0x158/0x180
system_call+0x5c/0x70
EXT4-fs (pmem1p2): no journal found
EXT4-fs (pmem1p2): can't get journal size
EXT4-fs (pmem1p2): mounted filesystem without journal. Opts: dax,norecovery
Fixes: 3c816ded78bb ("ext4: use journal inode to determine journal overhead")
Reported-by: Harish Sriram <harish@linux.ibm.com>
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200316093038.25485-1-riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:49:01 +02:00
..
2018-12-10 00:22:38 -05:00
2017-12-17 22:00:59 -05:00
2020-02-28 17:22:22 +01:00
2017-11-02 11:10:55 +01:00
2020-02-19 19:52:59 +01:00
2020-02-19 19:52:59 +01:00
2018-10-01 14:25:08 -04:00
2018-02-18 22:07:36 -05:00
2019-06-20 17:26:26 -04:00
2020-02-28 17:22:23 +01:00
2019-08-28 11:19:23 -04:00
2019-08-28 11:19:23 -04:00
2020-04-29 16:32:55 +02:00
2020-02-24 08:36:24 +01:00
2019-05-12 04:49:47 -04:00
2017-12-17 22:00:59 -05:00
2019-01-31 23:41:11 -05:00
2019-09-03 01:43:17 -04:00
2020-05-02 08:48:59 +02:00
2019-06-19 16:30:03 -04:00
2019-08-12 14:29:38 -04:00
2020-05-02 08:48:58 +02:00
2019-09-21 13:37:39 -07:00
2019-05-21 10:50:46 +02:00
2019-08-12 19:33:50 -07:00
2020-05-02 08:48:59 +02:00
2017-12-17 22:00:59 -05:00
2020-02-28 17:22:23 +01:00
2020-02-19 19:52:58 +01:00
2019-06-20 17:26:26 -04:00
2020-02-28 17:22:22 +01:00
2020-02-11 04:35:32 -08:00
2020-02-24 08:36:29 +01:00
2020-02-28 17:22:22 +01:00
2020-05-02 08:49:01 +02:00
2018-01-11 22:10:40 -05:00
2019-08-12 19:33:50 -07:00
2018-07-29 17:00:22 -04:00
2019-08-12 19:33:50 -07:00
2018-05-10 11:52:14 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-04-10 00:37:36 -04:00
2018-03-30 20:04:11 -04:00