diff --git a/patches.suse/dm-dax-Fix-table-reference-counts.patch b/patches.suse/dm-dax-Fix-table-reference-counts.patch new file mode 100644 index 0000000..d0ed9df --- /dev/null +++ b/patches.suse/dm-dax-Fix-table-reference-counts.patch @@ -0,0 +1,78 @@ +From: Dan Williams +Date: Fri, 18 Sep 2020 12:51:15 -0700 +Subject: dm/dax: Fix table reference counts +Patch-mainline: v5.9-rc6 +Git-commit: 02186d8897d49b0afd3c80b6cf23437d91024065 +References: bsc#1178246 + +A recent fix to the dm_dax_supported() flow uncovered a latent bug. When +dm_get_live_table() fails it is still required to drop the +srcu_read_lock(). Without this change the lvm2 test-suite triggers this +warning: + + # lvm2-testsuite --only pvmove-abort-all.sh + + WARNING: lock held when returning to user space! + 5.9.0-rc5+ #251 Tainted: G OE + ------------------------------------------------ + lvm/1318 is leaving the kernel with locks still held! + 1 lock held by lvm/1318: + #0: ffff9372abb5a340 (&md->io_barrier){....}-{0:0}, at: dm_get_live_table+0x5/0xb0 [dm_mod] + +...and later on this hang signature: + + INFO: task lvm:1344 blocked for more than 122 seconds. + Tainted: G OE 5.9.0-rc5+ #251 + "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + task:lvm state:D stack: 0 pid: 1344 ppid: 1 flags:0x00004000 + Call Trace: + __schedule+0x45f/0xa80 + ? finish_task_switch+0x249/0x2c0 + ? wait_for_completion+0x86/0x110 + schedule+0x5f/0xd0 + schedule_timeout+0x212/0x2a0 + ? __schedule+0x467/0xa80 + ? wait_for_completion+0x86/0x110 + wait_for_completion+0xb0/0x110 + __synchronize_srcu+0xd1/0x160 + ? __bpf_trace_rcu_utilization+0x10/0x10 + __dm_suspend+0x6d/0x210 [dm_mod] + dm_suspend+0xf6/0x140 [dm_mod] + +Fixes: 7bf7eac8d648 ("dax: Arrange for dax_supported check to span multiple devices") +Cc: +Cc: Jan Kara +Cc: Alasdair Kergon +Cc: Mike Snitzer +Reported-by: Adrian Huang +Reviewed-by: Ira Weiny +Tested-by: Adrian Huang +Link: https://lore.kernel.org/r/160045867590.25663.7548541079217827340.stgit@dwillia2-desk3.amr.corp.intel.com +Signed-off-by: Dan Williams +Acked-by: Michal Kubecek + +--- + drivers/md/dm.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -1130,15 +1130,16 @@ static bool dm_dax_supported(struct dax_device *dax_dev, struct block_device *bd + { + struct mapped_device *md = dax_get_private(dax_dev); + struct dm_table *map; ++ bool ret = false; + int srcu_idx; +- bool ret; + + map = dm_get_live_table(md, &srcu_idx); + if (!map) +- return false; ++ goto out; + + ret = dm_table_supports_dax(map, device_supports_dax, &blocksize); + ++out: + dm_put_live_table(md, srcu_idx); + + return ret; diff --git a/series.conf b/series.conf index bbda922..dec740c 100644 --- a/series.conf +++ b/series.conf @@ -15177,6 +15177,7 @@ patches.suse/USB-UAS-fix-disconnect-by-unplugging-a-hub.patch patches.suse/USB-quirks-Add-USB_QUIRK_IGNORE_REMOTE_WAKEUP-quirk-.patch patches.suse/usblp-fix-race-between-disconnect-and-read.patch + patches.suse/dm-dax-Fix-table-reference-counts.patch patches.suse/dm-Call-proper-helper-to-determine-dax-support.patch patches.suse/dax-Fix-compilation-for-CONFIG_DAX-CONFIG_FS_DAX.patch patches.suse/tracing-fix-double-free.patch