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