Roman Gushchin
593311e85b
writeback, cgroup: do not reparent dax inodes
...
The inode switching code is not suited for dax inodes. An attempt to
switch a dax inode to a parent writeback structure (as a part of a
writeback cleanup procedure) results in a panic like this:
run fstests generic/270 at 2021-07-15 05:54:02
XFS (pmem0p2): EXPERIMENTAL big timestamp feature in use. Use at your own risk!
XFS (pmem0p2): DAX enabled. Warning: EXPERIMENTAL, use at your own risk
XFS (pmem0p2): EXPERIMENTAL inode btree counters feature in use. Use at your own risk!
XFS (pmem0p2): Mounting V5 Filesystem
XFS (pmem0p2): Ending clean mount
XFS (pmem0p2): Quotacheck needed: Please wait.
XFS (pmem0p2): Quotacheck: Done.
XFS (pmem0p2): xlog_verify_grant_tail: space > BBTOB(tail_blocks)
XFS (pmem0p2): xlog_verify_grant_tail: space > BBTOB(tail_blocks)
XFS (pmem0p2): xlog_verify_grant_tail: space > BBTOB(tail_blocks)
BUG: unable to handle page fault for address: 0000000005b0f669
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1 ] SMP PTI
CPU: 13 PID: 10479 Comm: kworker/13:16 Not tainted 5.14.0-rc1-master-8096acd7442e+ #8
Hardware name: HP ProLiant DL360 Gen9/ProLiant DL360 Gen9, BIOS P89 09/13/2016
Workqueue: inode_switch_wbs inode_switch_wbs_work_fn
RIP: 0010:inode_do_switch_wbs+0xaf/0x470
Code: 00 30 0f 85 c1 03 00 00 0f 1f 44 00 00 31 d2 48 c7 c6 ff ff ff ff 48 8d 7c 24 08 e8 eb 49 1a 00 48 85 c0 74 4a bb ff ff ff ff <48> 8b 50 08 48 8d 4a ff 83 e2 01 48 0f 45 c1 48 8b 00 a8 08 0f 85
RSP: 0018:ffff9c66691abdc8 EFLAGS: 00010002
RAX: 0000000005b0f661 RBX: 00000000ffffffff RCX: ffff89e6a21382b0
RDX: 0000000000000001 RSI: ffff89e350230248 RDI: ffffffffffffffff
RBP: ffff89e681d19400 R08: 0000000000000000 R09: 0000000000000228
R10: ffffffffffffffff R11: ffffffffffffffc0 R12: ffff89e6a2138130
R13: ffff89e316af7400 R14: ffff89e316af6e78 R15: ffff89e6a21382b0
FS: 0000000000000000(0000) GS:ffff89ee5fb40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000005b0f669 CR3: 0000000cb2410004 CR4: 00000000001706e0
Call Trace:
inode_switch_wbs_work_fn+0xb6/0x2a0
process_one_work+0x1e6/0x380
worker_thread+0x53/0x3d0
kthread+0x10f/0x130
ret_from_fork+0x22/0x30
Modules linked in: xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter nf_tables nfnetlink bridge stp llc rfkill sunrpc intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel ipmi_ssif kvm mgag200 i2c_algo_bit iTCO_wdt irqbypass drm_kms_helper iTCO_vendor_support acpi_ipmi rapl syscopyarea sysfillrect intel_cstate ipmi_si sysimgblt ioatdma dax_pmem_compat fb_sys_fops ipmi_devintf device_dax i2c_i801 pcspkr intel_uncore hpilo nd_pmem cec dax_pmem_core dca i2c_smbus acpi_tad lpc_ich ipmi_msghandler acpi_power_meter drm fuse xfs libcrc32c sd_mod t10_pi crct10dif_pclmul crc32_pclmul crc32c_intel tg3 ghash_clmulni_intel serio_raw hpsa hpwdt scsi_transport_sas wmi dm_mirror dm_region_hash dm_log dm_mod
CR2: 0000000005b0f669
---[ end trace ed2105faff8384f3 ]---
RIP: 0010:inode_do_switch_wbs+0xaf/0x470
Code: 00 30 0f 85 c1 03 00 00 0f 1f 44 00 00 31 d2 48 c7 c6 ff ff ff ff 48 8d 7c 24 08 e8 eb 49 1a 00 48 85 c0 74 4a bb ff ff ff ff <48> 8b 50 08 48 8d 4a ff 83 e2 01 48 0f 45 c1 48 8b 00 a8 08 0f 85
RSP: 0018:ffff9c66691abdc8 EFLAGS: 00010002
RAX: 0000000005b0f661 RBX: 00000000ffffffff RCX: ffff89e6a21382b0
RDX: 0000000000000001 RSI: ffff89e350230248 RDI: ffffffffffffffff
RBP: ffff89e681d19400 R08: 0000000000000000 R09: 0000000000000228
R10: ffffffffffffffff R11: ffffffffffffffc0 R12: ffff89e6a2138130
R13: ffff89e316af7400 R14: ffff89e316af6e78 R15: ffff89e6a21382b0
FS: 0000000000000000(0000) GS:ffff89ee5fb40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000005b0f669 CR3: 0000000cb2410004 CR4: 00000000001706e0
Kernel panic - not syncing: Fatal exception
Kernel Offset: 0x15200000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: Fatal exception ]---
The crash happens on an attempt to iterate over attached pagecache pages
and check the dirty flag: a dax inode's xarray contains pfn's instead of
generic struct page pointers.
This happens for DAX and not for other kinds of non-page entries in the
inodes because it's a tagged iteration, and shadow/swap entries are
never tagged; only DAX entries get tagged.
Fix the problem by bailing out (with the false return value) of
inode_prepare_sbs_switch() if a dax inode is passed.
[willy@infradead.org: changelog addition]
Link: https://lkml.kernel.org/r/20210719171350.3876830-1-guro@fb.com
Fixes: c22d70a162d3 ("writeback, cgroup: release dying cgwbs by switching attached inodes")
Signed-off-by: Roman Gushchin <guro@fb.com>
Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
Reported-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Murphy Zhou <jencce.kernel@gmail.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-07-23 17:43:28 -07:00
..
2021-05-07 11:18:52 -07:00
2021-06-29 10:53:48 -07:00
2021-06-29 10:53:48 -07:00
2021-07-21 15:11:22 +01:00
2021-03-24 14:14:27 -04:00
2021-03-30 16:54:49 -07:00
2021-06-29 10:53:48 -07:00
2021-07-13 12:02:07 -07:00
2021-04-23 10:14:32 +01:00
2021-07-20 17:57:33 +02:00
2021-07-16 00:21:47 -05:00
2021-04-23 14:42:39 -07:00
2021-07-13 20:56:24 +02:00
2021-01-05 23:02:47 -05:00
2021-06-05 00:52:52 -07:00
2021-06-14 09:07:45 +02:00
2021-06-11 12:44:47 -05:00
2021-06-29 10:53:48 -07:00
2021-04-12 15:04:29 +02:00
2021-06-08 00:41:24 +08:00
2021-07-06 11:06:04 -07:00
2020-12-09 09:39:38 -05:00
2021-06-29 10:53:48 -07:00
2021-07-09 09:57:27 -07:00
2021-07-06 22:05:06 -07:00
2021-06-29 10:53:48 -07:00
2021-04-23 10:14:32 +01:00
2021-07-06 11:17:41 -07:00
2021-06-29 20:23:08 -07:00
2021-07-15 10:13:49 -07:00
2021-07-01 11:06:06 -07:00
2021-05-02 09:14:01 -07:00
2021-06-29 10:53:48 -07:00
2021-06-28 20:39:26 -07:00
2021-07-15 09:58:06 -07:00
2021-06-17 17:11:42 +02:00
2021-07-08 08:37:31 -04:00
2021-05-04 18:08:40 -07:00
2021-07-02 14:25:17 -07:00
2021-07-05 13:51:41 -07:00
2021-07-06 20:14:44 -04:00
2021-06-29 10:53:48 -07:00
2021-06-21 21:24:07 +01:00
2021-07-09 09:43:57 -07:00
2021-07-06 20:14:41 -04:00
2021-07-09 12:05:33 -07:00
2021-07-02 12:08:10 -07:00
2021-06-14 12:16:37 +02:00
2021-07-03 11:30:04 -07:00
2021-06-30 19:37:39 -07:00
2021-06-29 10:53:48 -07:00
2021-03-12 22:15:22 -05:00
2021-06-28 08:40:08 -04:00
2021-04-30 15:17:08 -07:00
2021-07-03 11:41:14 -07:00
2021-06-30 12:21:16 -07:00
2021-06-22 10:40:52 +02:00
2021-06-29 10:53:48 -07:00
2021-07-01 12:06:39 -07:00
2021-06-29 10:53:46 -07:00
2021-01-12 14:26:31 +01:00
2021-06-29 10:53:48 -07:00
2021-03-23 14:08:18 -04:00
2021-06-22 09:21:39 +02:00
2021-07-01 12:06:39 -07:00
2021-06-29 10:53:48 -07:00
2021-05-02 00:43:35 +09:00
2021-06-23 14:36:52 +02:00
2021-04-22 17:31:32 +10:00
2021-07-18 11:27:25 -07:00
2021-07-16 13:45:18 +09:00
2021-04-30 11:20:39 -07:00
2021-01-15 12:17:25 -05:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-06-29 10:53:50 -07:00
2021-06-29 17:29:11 -07:00
2021-06-29 17:29:11 -07:00
2021-06-29 10:53:50 -07:00
2021-03-13 11:27:30 -08:00
2021-07-05 13:42:16 -07:00
2021-06-29 10:53:48 -07:00
2021-01-06 08:42:51 -05:00
2021-07-03 11:41:14 -07:00
2021-05-18 20:15:58 -04:00
2021-06-29 10:53:47 -07:00
2021-04-15 22:36:45 -04:00
2021-04-09 14:54:23 -07:00
2021-05-06 19:24:13 -07:00
2021-07-02 12:08:10 -07:00
2021-07-12 11:09:13 -05:00
2021-04-07 13:56:43 -04:00
2021-05-03 11:05:28 -07:00
2021-07-14 09:19:06 -07:00
2021-04-30 11:20:35 -07:00
2021-07-23 17:43:28 -07:00
2021-01-24 14:27:19 +01:00
2021-05-05 11:27:20 -07:00
2021-04-07 13:56:43 -04:00
2021-07-11 16:39:06 -06:00
2021-06-18 09:22:02 -06:00
2021-06-18 09:22:02 -06:00
2021-04-12 15:04:23 +02:00
2021-06-30 20:47:26 -07:00
2021-04-19 09:56:37 +10:00
2021-04-07 13:56:43 -04:00
2021-06-29 10:53:48 -07:00
2021-05-05 13:44:19 -07:00
2021-04-23 10:14:32 +01:00
2021-01-24 14:29:34 +01:00
2021-03-11 07:47:48 -07:00
2021-07-03 11:41:14 -07:00
2021-06-01 12:09:27 +02:00
2021-07-03 11:41:14 -07:00
2021-02-24 13:38:26 -08:00
2021-03-08 15:18:43 +01:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:43:45 +01:00
2021-01-25 23:29:36 -05:00
2021-04-17 11:39:49 -07:00
2021-01-24 14:27:19 +01:00
2021-03-16 22:13:10 +01:00
2021-07-19 17:18:48 -07:00
2021-05-18 16:20:54 -05:00
2021-02-21 11:02:48 -08:00
2021-04-17 23:03:50 -04:00
2021-02-13 17:17:53 +01:00
2021-06-01 07:44:32 -06:00
2021-07-23 17:43:28 -07:00
2021-01-24 14:27:18 +01:00
2021-03-23 11:20:26 +01:00