From 1c23bb823e0bb6af813aca9307491c97d86cd9cb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 26 Mar 2019 10:29:52 +0900 Subject: [PATCH] 4.4-stable patches added patches: hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch --- ...d_invalidate-with-simultaneous-calls.patch | 59 +++++++++++++++++++ ...switch-block-size-for-dual-rate-mode.patch | 35 ----------- queue-4.4/series | 2 +- 3 files changed, 60 insertions(+), 36 deletions(-) create mode 100644 queue-4.4/hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch delete mode 100644 queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch diff --git a/queue-4.4/hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch b/queue-4.4/hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch new file mode 100644 index 00000000000..9f3d81d3490 --- /dev/null +++ b/queue-4.4/hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch @@ -0,0 +1,59 @@ +From 81be24d263dbeddaba35827036d6f6787a59c2c3 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sat, 3 Jun 2017 07:20:09 +0100 +Subject: Hang/soft lockup in d_invalidate with simultaneous calls + +From: Al Viro + +commit 81be24d263dbeddaba35827036d6f6787a59c2c3 upstream. + +It's not hard to trigger a bunch of d_invalidate() on the same +dentry in parallel. They end up fighting each other - any +dentry picked for removal by one will be skipped by the rest +and we'll go for the next iteration through the entire +subtree, even if everything is being skipped. Morevoer, we +immediately go back to scanning the subtree. The only thing +we really need is to dissolve all mounts in the subtree and +as soon as we've nothing left to do, we can just unhash the +dentry and bugger off. + +Signed-off-by: Al Viro +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + fs/dcache.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/fs/dcache.c ++++ b/fs/dcache.c +@@ -1510,7 +1510,7 @@ static void check_and_drop(void *_data) + { + struct detach_data *data = _data; + +- if (!data->mountpoint && !data->select.found) ++ if (!data->mountpoint && list_empty(&data->select.dispose)) + __d_drop(data->select.start); + } + +@@ -1552,17 +1552,15 @@ void d_invalidate(struct dentry *dentry) + + d_walk(dentry, &data, detach_and_collect, check_and_drop); + +- if (data.select.found) ++ if (!list_empty(&data.select.dispose)) + shrink_dentry_list(&data.select.dispose); ++ else if (!data.mountpoint) ++ return; + + if (data.mountpoint) { + detach_mounts(data.mountpoint); + dput(data.mountpoint); + } +- +- if (!data.mountpoint && !data.select.found) +- break; +- + cond_resched(); + } + } diff --git a/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch b/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch deleted file mode 100644 index f066925c9ec..00000000000 --- a/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1712c9373f98ae8ed41599a8d7841a6fba29c264 Mon Sep 17 00:00:00 2001 -From: Ziyuan Xu -Date: Wed, 21 Sep 2016 09:43:49 +0800 -Subject: mmc: core: don't try to switch block size for dual rate mode - -From: Ziyuan Xu - -commit 1712c9373f98ae8ed41599a8d7841a6fba29c264 upstream. - -Per spec, block size should always be 512 bytes for dual rate mode, -so any attempts to switch the block size under dual rate mode should -be neglected. - -Signed-off-by: Ziyuan Xu -Signed-off-by: Shawn Lin -Signed-off-by: Ulf Hansson -Signed-off-by: Arnd Bergmann -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/mmc/core/core.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/mmc/core/core.c -+++ b/drivers/mmc/core/core.c -@@ -2406,7 +2406,8 @@ int mmc_set_blocklen(struct mmc_card *ca - { - struct mmc_command cmd = {0}; - -- if (mmc_card_blockaddr(card) || mmc_card_ddr52(card)) -+ if (mmc_card_blockaddr(card) || mmc_card_ddr52(card) || -+ mmc_card_hs400(card) || mmc_card_hs400es(card)) - return 0; - - cmd.opcode = MMC_SET_BLOCKLEN; diff --git a/queue-4.4/series b/queue-4.4/series index a09d5b8bf54..6bc9378d658 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -25,6 +25,6 @@ extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch kbuild-setlocalversion-print-error-to-stderr.patch usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch -mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch serial-sprd-adjust-timeout-to-a-big-value.patch +hang-soft-lockup-in-d_invalidate-with-simultaneous-calls.patch -- 2.47.3