linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Harish Sriram <harish@linux.ibm.com>,
	Ritesh Harjani <riteshh@linux.ibm.com>, Jan Kara <jack@suse.cz>,
	Theodore Tso <tytso@mit.edu>
Subject: [PATCH 5.6 103/106] ext4: check for non-zero journal inum in ext4_calculate_overhead
Date: Fri,  1 May 2020 15:24:16 +0200	[thread overview]
Message-ID: <20200501131555.539026186@linuxfoundation.org> (raw)
In-Reply-To: <20200501131543.421333643@linuxfoundation.org>

From: Ritesh Harjani <riteshh@linux.ibm.com>

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>

---
 fs/ext4/super.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3610,7 +3610,8 @@ int ext4_calculate_overhead(struct super
 	 */
 	if (sbi->s_journal && !sbi->journal_bdev)
 		overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen);
-	else if (ext4_has_feature_journal(sb) && !sbi->s_journal) {
+	else if (ext4_has_feature_journal(sb) && !sbi->s_journal && j_inum) {
+		/* j_inum for internal journal is non-zero */
 		j_inode = ext4_get_journal_inode(sb, j_inum);
 		if (j_inode) {
 			j_blocks = j_inode->i_size >> sb->s_blocksize_bits;



  parent reply	other threads:[~2020-05-01 13:45 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 13:22 [PATCH 5.6 000/106] 5.6.9-rc1 review Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 001/106] ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans() Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 002/106] printk: queue wake_up_klogd irq_work only if per-CPU areas are ready Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 003/106] ASoC: stm32: sai: fix sai probe Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 004/106] usb: dwc3: gadget: Do link recovery for SS and SSP Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 005/106] ARM: dts: bcm283x: Add cells encoding format to firmware bus Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 006/106] kbuild: fix DT binding schema rule again to avoid needless rebuilds Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 007/106] usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 008/106] usb: gadget: udc: atmel: Fix vbus disconnect handling Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 009/106] afs: Make record checking use TASK_UNINTERRUPTIBLE when appropriate Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 010/106] afs: Fix to actually set AFS_SERVER_FL_HAVE_EPOCH Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 011/106] iio:ad7797: Use correct attribute_group Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 012/106] iio: imu: st_lsm6dsx: fix read misalignment on untagged FIFO Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 013/106] iio: imu: st_lsm6dsx: specify slave odr in slv_odr Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 014/106] propagate_one(): mnt_set_mountpoint() needs mount_lock Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 015/106] counter: 104-quad-8: Add lock guards - generic interface Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 016/106] s390/ftrace: fix potential crashes when switching tracers Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 017/106] ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 018/106] iwlwifi: actually check allocated conf_tlv pointer Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 019/106] ASoC: samsung: s3c24xx-i2s: Fix build after removal of DAI suspend/resume Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 020/106] ASoC: tas571x: disable regulators on failed probe Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 021/106] ASoC: meson: axg-card: fix codec-to-codec link setup Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 022/106] ASoC: wm8960: Fix wrong clock after suspend & resume Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 023/106] drivers: soc: xilinx: fix firmware driver Kconfig dependency Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 024/106] nfsd: memory corruption in nfsd4_lock() Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 025/106] ARM: dts: OMAP3: disable RNG on N950/N9 Greg Kroah-Hartman
2020-05-01 13:22 ` [PATCH 5.6 026/106] bpf: Forbid XADD on spilled pointers for unprivileged users Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 027/106] brcmfmac: add stub for monitor interface xmit Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 028/106] i2c: altera: use proper variable to hold errno Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 029/106] hwmon: (drivetemp) Use drivetemps true module name in Kconfig section Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 030/106] clk: asm9260: fix __clk_hw_register_fixed_rate_with_accuracy typo Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 031/106] rtw88: avoid unused function warnings Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 032/106] hwmon: (drivetemp) Return -ENODATA for invalid temperatures Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 033/106] rxrpc: Fix DATA Tx to disable nofrag for UDP on AF_INET6 socket Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 034/106] netfilter: nf_tables: reintroduce the NFT_SET_CONCAT flag Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 035/106] efi/x86: Dont remap text<->rodata gap read-only for mixed mode Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 036/106] net/cxgb4: Check the return from t4_query_params properly Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 037/106] tipc: fix incorrect increasing of link window Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 038/106] xfs: acquire superblock freeze protection on eofblocks scans Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 039/106] svcrdma: Fix trace point use-after-free race Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 040/106] svcrdma: Fix leak of svc_rdma_recv_ctxt objects Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 041/106] net/mlx5e: Dont trigger IRQ multiple times on XSK wakeup to avoid WQ overruns Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 042/106] net/mlx5e: Get the latest values from counters in switchdev mode Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 043/106] PCI: Avoid ASMedia XHCI USB PME# from D0 defect Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 044/106] PCI: Add Zhaoxin Vendor ID Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 045/106] PCI: Add ACS quirk for Zhaoxin multi-function devices Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 046/106] PCI: Add ACS quirk for Zhaoxin Root/Downstream Ports Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 047/106] PCI: Move Apex Edge TPU class quirk to fix BAR assignment Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 048/106] ARM: dts: bcm283x: Disable dsi0 node Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 049/106] cpumap: Avoid warning when CONFIG_DEBUG_PER_CPU_MAPS is enabled Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 050/106] s390/pci: do not set affinity for floating irqs Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 051/106] remoteproc: mtk_scp: use dma_addr_t for DMA API Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 052/106] net/mlx5: Fix failing fw tracer allocation on s390 Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 053/106] sched/core: Fix reset-on-fork from RT with uclamp Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 054/106] perf/core: fix parent pid/tid in task exit events Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 055/106] netfilter: nat: fix error handling upon registering inet hook Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 056/106] PM: sleep: core: Switch back to async_schedule_dev() Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 057/106] blk-iocost: Fix error on iocost_ioc_vrate_adj Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 058/106] um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/ Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 059/106] bpf: Fix handling of XADD on BTF memory Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 060/106] bpf, x86: Fix encoding for lower 8-bit registers in BPF_STX BPF_B Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 061/106] bpf, x86_32: Fix incorrect encoding in BPF_LDX zero-extension Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 062/106] bpf, x86_32: Fix clobbering of dst for BPF_JSET Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 063/106] bpf, x86_32: Fix logic error in BPF_LDX zero-extension Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 064/106] bpf: Propagate expected_attach_type when verifying freplace programs Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 065/106] selftests/bpf: Fix a couple of broken test_btf cases Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 066/106] mm: shmem: disable interrupt when acquiring info->lock in userfaultfd_copy path Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 067/106] xfs: clear PF_MEMALLOC before exiting xfsaild thread Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 068/106] libbpf: Initialize *nl_pid so gcc 10 is happy Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 069/106] net: fec: set GPR bit on suspend by DT configuration Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 070/106] x86: hyperv: report value of misc_features Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 071/106] signal: check sig before setting info in kill_pid_usb_asyncio Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 072/106] afs: Fix length of dump of bad YFSFetchStatus record Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 073/106] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 074/106] ALSA: hda: Release resources at error in delayed probe Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 075/106] ALSA: hda: Keep the controller initialization even if no codecs found Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 076/106] ALSA: hda: Explicitly permit using autosuspend if runtime PM is supported Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 077/106] drm/amdgpu: fix wrong vram lost counter increment V2 Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 078/106] scsi: target: fix PR IN / READ FULL STATUS for FC Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 079/106] scsi: target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 080/106] objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 081/106] objtool: Support Clang non-section symbols in ORC dump Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 082/106] xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 083/106] ALSA: hda: call runtime_allow() for all hda controllers Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 084/106] net: stmmac: socfpga: Allow all RGMII modes Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 085/106] mac80211: fix channel switch trigger from unknown mesh peer Greg Kroah-Hartman
2020-05-01 13:23 ` [PATCH 5.6 086/106] sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 087/106] sched/vtime: Work around an unitialized variable warning Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 088/106] arm64: Delete the space separator in __emit_inst Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 089/106] ext4: use matching invalidatepage in ext4_writepage Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 090/106] ext4: increase wait time needed before reuse of deleted inode numbers Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 091/106] ext4: convert BUG_ONs to WARN_ONs in mballoc.c Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 092/106] irqchip/gic-v4.1: Add support for VPENDBASERs Dirty+Valid signaling Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 093/106] blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 094/106] irqchip/meson-gpio: Fix HARDIRQ-safe -> HARDIRQ-unsafe lock order Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 095/106] hwmon: (jc42) Fix name to have no illegal characters Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 096/106] sfc: fix XDP-redirect in this driver Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 097/106] taprio: do not use BIT() in TCA_TAPRIO_ATTR_FLAG_* definitions Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 098/106] tipc: Add a missing case of TIPC_DIRECT_MSG type Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 099/106] qed: Fix race condition between scheduling and destroying the slowpath workqueue Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 100/106] Crypto: chelsio - Fixes a hang issue during driver registration Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 101/106] net: use indirect call wrappers for skb_copy_datagram_iter() Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 102/106] qed: Fix use after free in qed_chain_free Greg Kroah-Hartman
2020-05-01 13:24 ` Greg Kroah-Hartman [this message]
2020-05-01 13:24 ` [PATCH 5.6 104/106] ASoC: soc-pcm: fix regression in soc_new_pcm() Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 105/106] ASoC: soc-core: disable route checks for legacy devices Greg Kroah-Hartman
2020-05-01 13:24 ` [PATCH 5.6 106/106] ASoC: stm32: spdifrx: fix regmap status check Greg Kroah-Hartman
2020-05-01 15:17 ` [PATCH 5.6 000/106] 5.6.9-rc1 review Jon Hunter
2020-05-02  5:58   ` Greg Kroah-Hartman
2020-05-01 21:57 ` Naresh Kamboju
2020-05-01 22:18 ` Guenter Roeck
2020-05-02  6:17   ` Greg Kroah-Hartman
2020-05-02  7:15 ` Greg Kroah-Hartman
2020-05-02 23:14 ` shuah
2020-05-03  7:14   ` Greg Kroah-Hartman

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=20200501131555.539026186@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=harish@linux.ibm.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).