From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sahitya Tummala <stummala@codeaurora.org>,
Jaegeuk Kim <jaegeuk@kernel.org>, Sasha Levin <sashal@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH AUTOSEL 4.9 093/107] f2fs: fix sbi->extent_list corruption issue
Date: Mon, 28 Jan 2019 11:19:33 -0500 [thread overview]
Message-ID: <20190128161947.57405-93-sashal@kernel.org> (raw)
In-Reply-To: <20190128161947.57405-1-sashal@kernel.org>
From: Sahitya Tummala <stummala@codeaurora.org>
[ Upstream commit e4589fa545e0020dbbc3c9bde35f35f949901392 ]
When there is a failure in f2fs_fill_super() after/during
the recovery of fsync'd nodes, it frees the current sbi and
retries again. This time the mount is successful, but the files
that got recovered before retry, still holds the extent tree,
whose extent nodes list is corrupted since sbi and sbi->extent_list
is freed up. The list_del corruption issue is observed when the
file system is getting unmounted and when those recoverd files extent
node is being freed up in the below context.
list_del corruption. prev->next should be fffffff1e1ef5480, but was (null)
<...>
kernel BUG at kernel/msm-4.14/lib/list_debug.c:53!
lr : __list_del_entry_valid+0x94/0xb4
pc : __list_del_entry_valid+0x94/0xb4
<...>
Call trace:
__list_del_entry_valid+0x94/0xb4
__release_extent_node+0xb0/0x114
__free_extent_tree+0x58/0x7c
f2fs_shrink_extent_tree+0xdc/0x3b0
f2fs_leave_shrinker+0x28/0x7c
f2fs_put_super+0xfc/0x1e0
generic_shutdown_super+0x70/0xf4
kill_block_super+0x2c/0x5c
kill_f2fs_super+0x44/0x50
deactivate_locked_super+0x60/0x8c
deactivate_super+0x68/0x74
cleanup_mnt+0x40/0x78
__cleanup_mnt+0x1c/0x28
task_work_run+0x48/0xd0
do_notify_resume+0x678/0xe98
work_pending+0x8/0x14
Fix this by not creating extents for those recovered files if shrinker is
not registered yet. Once mount is successful and shrinker is registered,
those files can have extents again.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/f2fs.h | 11 ++++++++++-
fs/f2fs/shrinker.c | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 662084490089..6c069c9c0bb6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1886,10 +1886,19 @@ static inline bool is_dot_dotdot(const struct qstr *str)
static inline bool f2fs_may_extent_tree(struct inode *inode)
{
- if (!test_opt(F2FS_I_SB(inode), EXTENT_CACHE) ||
+ struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+
+ if (!test_opt(sbi, EXTENT_CACHE) ||
is_inode_flag_set(inode, FI_NO_EXTENT))
return false;
+ /*
+ * for recovered files during mount do not create extents
+ * if shrinker is not registered.
+ */
+ if (list_empty(&sbi->s_list))
+ return false;
+
return S_ISREG(inode->i_mode);
}
diff --git a/fs/f2fs/shrinker.c b/fs/f2fs/shrinker.c
index 46c915425923..a40bfa7fafec 100644
--- a/fs/f2fs/shrinker.c
+++ b/fs/f2fs/shrinker.c
@@ -136,6 +136,6 @@ void f2fs_leave_shrinker(struct f2fs_sb_info *sbi)
f2fs_shrink_extent_tree(sbi, __count_extent_cache(sbi));
spin_lock(&f2fs_list_lock);
- list_del(&sbi->s_list);
+ list_del_init(&sbi->s_list);
spin_unlock(&f2fs_list_lock);
}
--
2.19.1
next prev parent reply other threads:[~2019-01-28 16:23 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 16:18 [PATCH AUTOSEL 4.9 001/107] drm/bufs: Fix Spectre v1 vulnerability Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 002/107] staging: iio: adc: ad7280a: handle error from __ad7280_read32() Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 003/107] ASoC: Intel: mrfld: fix uninitialized variable access Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 004/107] gpu: ipu-v3: image-convert: Prevent race between run and unprepare Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 005/107] ath9k: dynack: use authentication messages for 'late' ack Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 006/107] scsi: lpfc: Correct LCB RJT handling Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 007/107] platform/x86: asus-nb-wmi: Map 0x35 to KEY_SCREENLOCK Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 008/107] ARM: 8808/1: kexec:offline panic_smp_self_stop CPU Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 009/107] dlm: Don't swamp the CPU with callbacks queued during recovery Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 010/107] x86/PCI: Fix Broadcom CNB20LE unintended sign extension (redux) Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 011/107] powerpc/pseries: add of_node_put() in dlpar_detach_node() Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 012/107] drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONE Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 013/107] serial: fsl_lpuart: clear parity enable bit when disable parity Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 014/107] serial: core: Allow processing sysrq at port unlock time Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 015/107] ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 016/107] staging:iio:ad2s90: Make probe handle spi_setup failure Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 017/107] staging: iio: ad7780: update voltage on read Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 018/107] ARM: OMAP2+: hwmod: Fix some section annotations Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 019/107] modpost: validate symbol names also in find_elf_symbol Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 020/107] perf tools: Add Hygon Dhyana support Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 021/107] soc/tegra: Don't leak device tree node reference Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 022/107] media: mtk-vcodec: Release device nodes in mtk_vcodec_init_enc_pm() Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 023/107] dmaengine: xilinx_dma: Remove __aligned attribute on zynqmp_dma_desc_ll Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 024/107] iio: accel: kxcjk1013: Add KIOX010A ACPI Hardware-ID Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 025/107] media: adv*/tc358743/ths8200: fill in min width/height/pixelclock Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 026/107] f2fs: move dir data flush to write checkpoint process Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 027/107] f2fs: avoid build warn of fall_through Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 028/107] f2fs: fix wrong return value of f2fs_acl_create Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 029/107] sunvdc: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 030/107] soc: bcm: brcmstb: Don't leak device tree node reference Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 031/107] nfsd4: fix crash on writing v4_end_grace before nfsd startup Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 032/107] Thermal: do not clear passive state during system sleep Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 033/107] firmware/efi: Add NULL pointer checks in efivars API functions Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 034/107] arm64: ftrace: don't adjust the LR value Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 035/107] ARM: dts: mmp2: fix TWSI2 Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 036/107] ARM: mmp/mmp2: dt: enable the clock Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 037/107] x86/fpu: Add might_fault() to user_insn() Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 038/107] media: DaVinci-VPBE: fix error handling in vpbe_initialize() Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 039/107] smack: fix access permissions for keyring Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 040/107] usb: hub: delay hub autosuspend if USB3 port is still link training Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 041/107] timekeeping: Use proper seqcount initializer Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 042/107] clk: sunxi-ng: a33: Set CLK_SET_RATE_PARENT for all audio module clocks Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 043/107] iommu/amd: Fix amd_iommu=force_isolation Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 044/107] ARM: dts: Fix OMAP4430 SDP Ethernet startup Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 045/107] mips: bpf: fix encoding bug for mm_srlv32_op Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 046/107] tracing: Have trace_stack nr_entries compare not be so subtle Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 047/107] Input: rotary-encoder - don't log EPROBE_DEFER to kernel log Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 048/107] iommu/arm-smmu: Add support for qcom,smmu-v2 variant Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 049/107] iommu/arm-smmu-v3: Use explicit mb() when moving cons pointer Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 050/107] sata_rcar: fix deferred probing Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 051/107] clk: imx6sl: ensure MMDC CH0 handshake is bypassed Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 052/107] cpuidle: big.LITTLE: fix refcount leak Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 053/107] i2c-axxia: check for error conditions first Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 054/107] udf: Fix BUG on corrupted inode Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 055/107] ARM: pxa: avoid section mismatch warning Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 056/107] ASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 057/107] ARM: mmp: fix timer_init calls Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 058/107] memstick: Prevent memstick host from getting runtime suspended during card detection Sasha Levin
2019-01-28 16:18 ` [PATCH AUTOSEL 4.9 059/107] tty: serial: samsung: Properly set flags in autoCTS mode Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 060/107] perf header: Fix unchecked usage of strncpy() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 061/107] perf probe: " Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 062/107] KVM: s390: unregister debug feature on failing arch init Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 063/107] arm64: KVM: Skip MMIO insn after emulation Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 064/107] powerpc/uaccess: fix warning/error with access_ok() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 065/107] mac80211: fix radiotap vendor presence bitmap handling Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 066/107] xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 067/107] Bluetooth: Fix unnecessary error message for HCI request completion Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 068/107] scsi: smartpqi: correct host serial num for ssa Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 069/107] scsi: smartpqi: correct volume status Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 070/107] cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 071/107] drbd: narrow rcu_read_lock in drbd_sync_handshake Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 072/107] drbd: disconnect, if the wrong UUIDs are attached on a connected peer Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 073/107] drbd: skip spurious timeout (ping-timeo) when failing promote Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 074/107] drbd: Avoid Clang warning about pointless switch statment Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 075/107] video: clps711x-fb: release disp device node in probe() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 076/107] fbdev: fbmem: behave better with small rotated displays and many CPUs Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 077/107] i40e: define proper net_device::neigh_priv_len Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 078/107] igb: Fix an issue that PME is not enabled during runtime suspend Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 079/107] fbdev: fbcon: Fix unregister crash when more than one framebuffer Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 080/107] pinctrl: meson: meson8: fix the GPIO function for the GPIOAO pins Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 081/107] pinctrl: meson: meson8b: " Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 082/107] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 083/107] NFS: nfs_compare_mount_options always compare auth flavors Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 084/107] hwmon: (lm80) fix a missing check of the status of SMBus read Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 085/107] hwmon: (lm80) fix a missing check of bus read in lm80 probe Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 086/107] seq_buf: Make seq_buf_puts() null-terminate the buffer Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 087/107] crypto: ux500 - Use proper enum in cryp_set_dma_transfer Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 088/107] crypto: ux500 - Use proper enum in hash_set_dma_transfer Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 089/107] MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 090/107] cifs: check ntwrk_buf_start for NULL before dereferencing it Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 091/107] um: Avoid marking pages with "changed protection" Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 092/107] niu: fix missing checks of niu_pci_eeprom_read Sasha Levin
2019-01-28 16:19 ` Sasha Levin [this message]
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 094/107] scripts/decode_stacktrace: only strip base path when a prefix of the path Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 095/107] mm/page_owner: clamp read count to PAGE_SIZE Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 096/107] ocfs2: don't clear bh uptodate for block read Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 097/107] isdn: hisax: hfc_pci: Fix a possible concurrency use-after-free bug in HFCPCI_l1hw() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 098/107] gdrom: fix a memory leak bug Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 099/107] fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 100/107] block/swim3: Fix -EBUSY error when re-opening device after unmount Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 101/107] thermal: generic-adc: Fix adc to temp interpolation Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 102/107] HID: lenovo: Add checks to fix of_led_classdev_register Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 103/107] fs/proc/base.c: use ns_capable instead of capable for timerslack_ns Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 104/107] kernel/hung_task.c: break RCU locks based on jiffies Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 105/107] proc/sysctl: fix return error for proc_doulongvec_minmax() Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 106/107] fs/epoll: drop ovflist branch prediction Sasha Levin
2019-01-28 16:19 ` [PATCH AUTOSEL 4.9 107/107] exec: load_script: don't blindly truncate shebang string Sasha Levin
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=20190128161947.57405-93-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stummala@codeaurora.org \
/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
all inboxes | Powered by JetHome®