Ritesh Harjani
c65024b376
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 17:24:46 +02:00
..
2019-10-11 18:18:38 +02:00
2019-08-06 19:05:21 +02:00
2020-01-27 14:46:52 +01:00
2020-04-02 16:34:33 +02:00
2019-12-17 20:37:24 +01:00
2017-11-02 11:10:55 +01:00
2018-12-01 09:42:51 +01:00
2020-04-24 08:00:56 +02:00
2018-12-17 09:28:53 +01:00
2020-05-02 17:24:13 +02:00
2020-04-24 08:00:40 +02:00
2019-08-06 19:05:23 +02:00
2019-11-12 19:18:18 +01:00
2018-11-13 11:15:12 -08:00
2019-07-31 07:28:22 +02:00
2019-05-08 07:20:49 +02:00
2019-03-23 14:35:21 +01:00
2019-12-17 20:38:33 +01:00
2020-03-11 18:02:51 +01:00
2017-11-02 11:10:55 +01:00
2019-12-05 15:37:28 +01:00
2020-01-27 14:46:06 +01:00
2020-04-24 08:01:22 +02:00
2020-05-02 17:24:46 +02:00
2020-02-28 16:36:05 +01:00
2020-03-11 18:03:03 +01:00
2018-12-17 09:28:53 +01:00
2019-12-17 20:38:44 +01:00
2020-04-24 08:00:27 +02:00
2019-12-01 09:13:57 +01:00
2020-04-24 08:00:45 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-31 06:47:12 -07:00
2018-10-03 17:00:57 -07:00
2020-04-24 08:00:54 +02:00
2019-05-08 07:20:49 +02:00
2020-01-27 14:46:26 +01:00
2019-12-17 20:38:50 +01:00
2019-12-17 20:38:15 +01:00
2017-11-02 11:10:55 +01:00
2018-03-28 18:24:43 +02:00
2020-04-24 08:01:21 +02:00
2018-02-03 17:39:08 +01:00
2020-05-02 17:24:41 +02:00
2018-05-30 07:51:47 +02:00
2017-11-02 11:10:55 +01:00
2020-01-12 12:11:59 +01:00
2017-11-02 11:10:55 +01:00
2020-04-24 08:00:43 +02:00
2017-11-02 11:10:55 +01:00
2020-02-28 16:36:08 +01:00
2019-12-17 20:39:21 +01:00
2020-05-02 17:24:21 +02:00
2020-01-09 10:17:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-01-12 12:11:59 +01:00
2017-09-06 17:27:26 -07:00
2020-02-28 16:36:08 +01:00
2017-11-02 11:10:55 +01:00
2018-09-05 09:26:32 +02:00
2018-09-05 09:26:41 +02:00
2018-12-17 09:28:48 +01:00
2020-02-14 16:32:11 -05:00
2020-02-28 16:36:02 +01:00
2019-05-25 18:25:36 +02:00
2020-05-02 17:24:43 +02:00
2018-12-21 14:13:04 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 18:13:32 -07:00
2019-10-05 12:48:06 +02:00
2019-07-03 13:15:59 +02:00
2018-06-26 08:06:33 +08:00
2019-11-06 12:42:59 +01:00
2019-04-17 08:37:53 +02:00
2020-04-24 08:01:00 +02:00
2020-01-14 20:05:39 +01:00
2020-01-09 10:17:58 +01:00
2017-11-02 11:10:55 +01:00
2020-03-11 18:02:43 +01:00
2019-02-06 17:31:34 +01:00
2019-04-27 09:35:41 +02:00
2020-01-12 12:11:59 +01:00
2019-02-12 19:46:10 +01:00
2020-04-24 08:00:38 +02:00
2017-12-17 15:07:59 +01:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:31:28 +02:00
2020-04-24 08:00:43 +02:00
2017-11-02 11:10:55 +01:00
2019-11-12 19:18:47 +01:00
2020-04-02 16:34:21 +02:00
2017-09-13 09:11:44 -07:00
2018-11-10 07:48:33 -08:00
2019-12-17 20:38:57 +01:00
2020-04-02 16:34:35 +02:00
2020-01-09 10:17:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:25 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-03-11 18:02:53 +01:00
2020-05-02 17:24:20 +02:00
2017-11-02 11:10:55 +01:00
2020-03-20 10:54:16 +01:00
2019-05-04 09:15:18 +02:00
2017-11-02 11:10:55 +01:00
2019-12-01 09:13:51 +01:00
2020-01-04 14:00:04 +01:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:28 +01:00
2017-11-02 11:10:55 +01:00
2019-05-04 09:15:18 +02:00
2017-11-02 11:10:55 +01:00
2019-10-11 18:18:48 +02:00
2018-05-30 07:51:47 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-01-04 13:59:58 +01:00
2017-11-02 11:10:55 +01:00
2018-10-10 08:54:27 +02:00