From: Greg Kroah-Hartman Date: Sat, 20 Mar 2021 11:53:07 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.263~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=865b45585039ec2f869ee5f519d37036f836467e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: afs-stop-listxattr-from-listing-afs.-attributes.patch asoc-fsl_ssi-fix-tdm-slot-setup-for-i2s-mode.patch asoc-simple-card-utils-do-not-handle-device-clock.patch asoc-sof-intel-fix-wrong-poll-bits-in-dsp-power-down.patch asoc-sof-intel-unregister-dmic-device-on-probe-error.patch nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch nvme-fix-write-zeroes-limitations.patch nvme-tcp-fix-a-null-deref-when-receiving-a-0-length-r2t-pdu.patch nvme-tcp-fix-possible-hang-when-failing-to-set-io-queues.patch nvmet-don-t-check-iosqes-iocqes-for-discovery-controllers.patch sunrpc-fix-refcount-leak-for-rpc-auth-modules.patch svcrdma-disable-timeouts-on-rdma-backchannel.patch vfio-iommu_api-should-be-selected.patch --- diff --git a/queue-5.4/afs-stop-listxattr-from-listing-afs.-attributes.patch b/queue-5.4/afs-stop-listxattr-from-listing-afs.-attributes.patch new file mode 100644 index 00000000000..527d0bd1fee --- /dev/null +++ b/queue-5.4/afs-stop-listxattr-from-listing-afs.-attributes.patch @@ -0,0 +1,133 @@ +From a7889c6320b9200e3fe415238f546db677310fa9 Mon Sep 17 00:00:00 2001 +From: David Howells +Date: Tue, 9 Mar 2021 08:27:39 +0000 +Subject: afs: Stop listxattr() from listing "afs.*" attributes + +From: David Howells + +commit a7889c6320b9200e3fe415238f546db677310fa9 upstream. + +afs_listxattr() lists all the available special afs xattrs (i.e. those in +the "afs.*" space), no matter what type of server we're dealing with. But +OpenAFS servers, for example, cannot deal with some of the extra-capable +attributes that AuriStor (YFS) servers provide. Unfortunately, the +presence of the afs.yfs.* attributes causes errors[1] for anything that +tries to read them if the server is of the wrong type. + +Fix the problem by removing afs_listxattr() so that none of the special +xattrs are listed (AFS doesn't support xattrs). It does mean, however, +that getfattr won't list them, though they can still be accessed with +getxattr() and setxattr(). + +This can be tested with something like: + + getfattr -d -m ".*" /afs/example.com/path/to/file + +With this change, none of the afs.* attributes should be visible. + +Changes: +ver #2: + - Hide all of the afs.* xattrs, not just the ACL ones. + +Fixes: ae46578b963f ("afs: Get YFS ACLs and information through xattrs") +Reported-by: Gaja Sophie Peters +Signed-off-by: David Howells +Tested-by: Gaja Sophie Peters +Reviewed-by: Jeffrey Altman +Reviewed-by: Marc Dionne +cc: linux-afs@lists.infradead.org +Link: http://lists.infradead.org/pipermail/linux-afs/2021-March/003502.html [1] +Link: http://lists.infradead.org/pipermail/linux-afs/2021-March/003567.html # v1 +Link: http://lists.infradead.org/pipermail/linux-afs/2021-March/003573.html # v2 +Signed-off-by: Greg Kroah-Hartman +--- + fs/afs/dir.c | 1 - + fs/afs/file.c | 1 - + fs/afs/inode.c | 1 - + fs/afs/internal.h | 1 - + fs/afs/mntpt.c | 1 - + fs/afs/xattr.c | 23 ----------------------- + 6 files changed, 28 deletions(-) + +--- a/fs/afs/dir.c ++++ b/fs/afs/dir.c +@@ -69,7 +69,6 @@ const struct inode_operations afs_dir_in + .permission = afs_permission, + .getattr = afs_getattr, + .setattr = afs_setattr, +- .listxattr = afs_listxattr, + }; + + const struct address_space_operations afs_dir_aops = { +--- a/fs/afs/file.c ++++ b/fs/afs/file.c +@@ -42,7 +42,6 @@ const struct inode_operations afs_file_i + .getattr = afs_getattr, + .setattr = afs_setattr, + .permission = afs_permission, +- .listxattr = afs_listxattr, + }; + + const struct address_space_operations afs_fs_aops = { +--- a/fs/afs/inode.c ++++ b/fs/afs/inode.c +@@ -27,7 +27,6 @@ + + static const struct inode_operations afs_symlink_inode_operations = { + .get_link = page_get_link, +- .listxattr = afs_listxattr, + }; + + static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *parent_vnode) +--- a/fs/afs/internal.h ++++ b/fs/afs/internal.h +@@ -1354,7 +1354,6 @@ extern int afs_launder_page(struct page + * xattr.c + */ + extern const struct xattr_handler *afs_xattr_handlers[]; +-extern ssize_t afs_listxattr(struct dentry *, char *, size_t); + + /* + * yfsclient.c +--- a/fs/afs/mntpt.c ++++ b/fs/afs/mntpt.c +@@ -32,7 +32,6 @@ const struct inode_operations afs_mntpt_ + .lookup = afs_mntpt_lookup, + .readlink = page_readlink, + .getattr = afs_getattr, +- .listxattr = afs_listxattr, + }; + + const struct inode_operations afs_autocell_inode_operations = { +--- a/fs/afs/xattr.c ++++ b/fs/afs/xattr.c +@@ -11,29 +11,6 @@ + #include + #include "internal.h" + +-static const char afs_xattr_list[] = +- "afs.acl\0" +- "afs.cell\0" +- "afs.fid\0" +- "afs.volume\0" +- "afs.yfs.acl\0" +- "afs.yfs.acl_inherited\0" +- "afs.yfs.acl_num_cleaned\0" +- "afs.yfs.vol_acl"; +- +-/* +- * Retrieve a list of the supported xattrs. +- */ +-ssize_t afs_listxattr(struct dentry *dentry, char *buffer, size_t size) +-{ +- if (size == 0) +- return sizeof(afs_xattr_list); +- if (size < sizeof(afs_xattr_list)) +- return -ERANGE; +- memcpy(buffer, afs_xattr_list, sizeof(afs_xattr_list)); +- return sizeof(afs_xattr_list); +-} +- + /* + * Get a file's ACL. + */ diff --git a/queue-5.4/asoc-fsl_ssi-fix-tdm-slot-setup-for-i2s-mode.patch b/queue-5.4/asoc-fsl_ssi-fix-tdm-slot-setup-for-i2s-mode.patch new file mode 100644 index 00000000000..8ab23462534 --- /dev/null +++ b/queue-5.4/asoc-fsl_ssi-fix-tdm-slot-setup-for-i2s-mode.patch @@ -0,0 +1,49 @@ +From 87263968516fb9507d6215d53f44052627fae8d8 Mon Sep 17 00:00:00 2001 +From: Alexander Shiyan +Date: Tue, 16 Feb 2021 14:42:21 +0300 +Subject: ASoC: fsl_ssi: Fix TDM slot setup for I2S mode + +From: Alexander Shiyan + +commit 87263968516fb9507d6215d53f44052627fae8d8 upstream. + +When using the driver in I2S TDM mode, the _fsl_ssi_set_dai_fmt() +function rewrites the number of slots previously set by the +fsl_ssi_set_dai_tdm_slot() function to 2 by default. +To fix this, let's use the saved slot count value or, if TDM +is not used and the slot count is not set, proceed as before. + +Fixes: 4f14f5c11db1 ("ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode") +Signed-off-by: Alexander Shiyan +Acked-by: Nicolin Chen +Link: https://lore.kernel.org/r/20210216114221.26635-1-shc_work@mail.ru +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/fsl/fsl_ssi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/sound/soc/fsl/fsl_ssi.c ++++ b/sound/soc/fsl/fsl_ssi.c +@@ -873,6 +873,7 @@ static int fsl_ssi_hw_free(struct snd_pc + static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt) + { + u32 strcr = 0, scr = 0, stcr, srcr, mask; ++ unsigned int slots; + + ssi->dai_fmt = fmt; + +@@ -904,10 +905,11 @@ static int _fsl_ssi_set_dai_fmt(struct f + return -EINVAL; + } + ++ slots = ssi->slots ? : 2; + regmap_update_bits(ssi->regs, REG_SSI_STCCR, +- SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2)); ++ SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots)); + regmap_update_bits(ssi->regs, REG_SSI_SRCCR, +- SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2)); ++ SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots)); + + /* Data on rising edge of bclk, frame low, 1clk before data */ + strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP | SSI_STCR_TEFS; diff --git a/queue-5.4/asoc-simple-card-utils-do-not-handle-device-clock.patch b/queue-5.4/asoc-simple-card-utils-do-not-handle-device-clock.patch new file mode 100644 index 00000000000..63073744385 --- /dev/null +++ b/queue-5.4/asoc-simple-card-utils-do-not-handle-device-clock.patch @@ -0,0 +1,56 @@ +From 8ca88d53351cc58d535b2bfc7386835378fb0db2 Mon Sep 17 00:00:00 2001 +From: Sameer Pujar +Date: Mon, 15 Mar 2021 23:01:31 +0530 +Subject: ASoC: simple-card-utils: Do not handle device clock + +From: Sameer Pujar + +commit 8ca88d53351cc58d535b2bfc7386835378fb0db2 upstream. + +This reverts commit 1e30f642cf29 ("ASoC: simple-card-utils: Fix device +module clock"). The original patch ended up breaking following platform, +which depends on set_sysclk() to configure internal PLL on wm8904 codec +and expects simple-card-utils to not update the MCLK rate. + - "arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts" + +It would be best if codec takes care of setting MCLK clock via DAI +set_sysclk() callback. + +Reported-by: Michael Walle +Suggested-by: Mark Brown +Suggested-by: Michael Walle +Fixes: 1e30f642cf29 ("ASoC: simple-card-utils: Fix device module clock") +Signed-off-by: Sameer Pujar +Tested-by: Michael Walle +Link: https://lore.kernel.org/r/1615829492-8972-2-git-send-email-spujar@nvidia.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/generic/simple-card-utils.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/sound/soc/generic/simple-card-utils.c ++++ b/sound/soc/generic/simple-card-utils.c +@@ -172,15 +172,16 @@ int asoc_simple_parse_clk(struct device + * or device's module clock. + */ + clk = devm_get_clk_from_child(dev, node, NULL); +- if (IS_ERR(clk)) +- clk = devm_get_clk_from_child(dev, dlc->of_node, NULL); +- + if (!IS_ERR(clk)) { +- simple_dai->clk = clk; + simple_dai->sysclk = clk_get_rate(clk); +- } else if (!of_property_read_u32(node, "system-clock-frequency", +- &val)) { ++ ++ simple_dai->clk = clk; ++ } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { + simple_dai->sysclk = val; ++ } else { ++ clk = devm_get_clk_from_child(dev, dlc->of_node, NULL); ++ if (!IS_ERR(clk)) ++ simple_dai->sysclk = clk_get_rate(clk); + } + + if (of_property_read_bool(node, "system-clock-direction-out")) diff --git a/queue-5.4/asoc-sof-intel-fix-wrong-poll-bits-in-dsp-power-down.patch b/queue-5.4/asoc-sof-intel-fix-wrong-poll-bits-in-dsp-power-down.patch new file mode 100644 index 00000000000..fc2c747a6c7 --- /dev/null +++ b/queue-5.4/asoc-sof-intel-fix-wrong-poll-bits-in-dsp-power-down.patch @@ -0,0 +1,35 @@ +From fd8299181995093948ec6ca75432e797b4a39143 Mon Sep 17 00:00:00 2001 +From: Pan Xiuli +Date: Mon, 8 Mar 2021 18:41:27 -0600 +Subject: ASoC: SOF: intel: fix wrong poll bits in dsp power down + +From: Pan Xiuli + +commit fd8299181995093948ec6ca75432e797b4a39143 upstream. + +The ADSPCS_SPA is Set Power Active bit. To check if DSP is powered +down, we need to check ADSPCS_CPA, the Current Power Active bit. + +Fixes: 747503b1813a3 ("ASoC: SOF: Intel: Add Intel specific HDA DSP HW operations") +Reviewed-by: Rander Wang +Reviewed-by: Ranjani Sridharan +Signed-off-by: Pan Xiuli +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20210309004127.4940-1-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/intel/hda-dsp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -179,7 +179,7 @@ int hda_dsp_core_power_down(struct snd_s + + return snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, + HDA_DSP_REG_ADSPCS, adspcs, +- !(adspcs & HDA_DSP_ADSPCS_SPA_MASK(core_mask)), ++ !(adspcs & HDA_DSP_ADSPCS_CPA_MASK(core_mask)), + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC); + } diff --git a/queue-5.4/asoc-sof-intel-unregister-dmic-device-on-probe-error.patch b/queue-5.4/asoc-sof-intel-unregister-dmic-device-on-probe-error.patch new file mode 100644 index 00000000000..a7000143e89 --- /dev/null +++ b/queue-5.4/asoc-sof-intel-unregister-dmic-device-on-probe-error.patch @@ -0,0 +1,34 @@ +From 5bb0ecddb2a7f638d65e457f3da9fa334c967b14 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Mon, 1 Mar 2021 18:34:10 -0600 +Subject: ASoC: SOF: Intel: unregister DMIC device on probe error + +From: Pierre-Louis Bossart + +commit 5bb0ecddb2a7f638d65e457f3da9fa334c967b14 upstream. + +We only unregister the platform device during the .remove operation, +but if the probe fails we will never reach this sequence. + +Suggested-by: Bard Liao +Fixes: dd96daca6c83e ("ASoC: SOF: Intel: Add APL/CNL HW DSP support") +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Ranjani Sridharan +Reviewed-by: Guennadi Liakhovetski +Link: https://lore.kernel.org/r/20210302003410.1178535-1-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/intel/hda.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -672,6 +672,7 @@ free_streams: + /* dsp_unmap: not currently used */ + iounmap(sdev->bar[HDA_DSP_BAR]); + hdac_bus_unmap: ++ platform_device_unregister(hdev->dmic_dev); + iounmap(bus->remap_addr); + err: + return ret; diff --git a/queue-5.4/nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch b/queue-5.4/nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch new file mode 100644 index 00000000000..17b4da91ff2 --- /dev/null +++ b/queue-5.4/nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch @@ -0,0 +1,33 @@ +From d30881f573e565ebb5dbb50b31ed6106b5c81328 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Thu, 18 Feb 2021 21:02:07 -0500 +Subject: nfsd: Don't keep looking up unhashed files in the nfsd file cache + +From: Trond Myklebust + +commit d30881f573e565ebb5dbb50b31ed6106b5c81328 upstream. + +If a file is unhashed, then we're going to reject it anyway and retry, +so make sure we skip it when we're doing the RCU lockless lookup. +This avoids a number of unnecessary nfserr_jukebox returns from +nfsd_file_acquire() + +Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd") +Signed-off-by: Trond Myklebust +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/filecache.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/nfsd/filecache.c ++++ b/fs/nfsd/filecache.c +@@ -751,6 +751,8 @@ nfsd_file_find_locked(struct inode *inod + continue; + if (!nfsd_match_cred(nf->nf_cred, current_cred())) + continue; ++ if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) ++ continue; + if (nfsd_file_get(nf) != NULL) + return nf; + } diff --git a/queue-5.4/nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch b/queue-5.4/nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch new file mode 100644 index 00000000000..b6bef63d19b --- /dev/null +++ b/queue-5.4/nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch @@ -0,0 +1,152 @@ +From c7de87ff9dac5f396f62d584f3908f80ddc0e07b Mon Sep 17 00:00:00 2001 +From: Joe Korty +Date: Fri, 26 Feb 2021 09:38:20 -0500 +Subject: NFSD: Repair misuse of sv_lock in 5.10.16-rt30. + +From: Joe Korty + +commit c7de87ff9dac5f396f62d584f3908f80ddc0e07b upstream. + +[ This problem is in mainline, but only rt has the chops to be +able to detect it. ] + +Lockdep reports a circular lock dependency between serv->sv_lock and +softirq_ctl.lock on system shutdown, when using a kernel built with +CONFIG_PREEMPT_RT=y, and a nfs mount exists. + +This is due to the definition of spin_lock_bh on rt: + + local_bh_disable(); + rt_spin_lock(lock); + +which forces a softirq_ctl.lock -> serv->sv_lock dependency. This is +not a problem as long as _every_ lock of serv->sv_lock is a: + + spin_lock_bh(&serv->sv_lock); + +but there is one of the form: + + spin_lock(&serv->sv_lock); + +This is what is causing the circular dependency splat. The spin_lock() +grabs the lock without first grabbing softirq_ctl.lock via local_bh_disable. +If later on in the critical region, someone does a local_bh_disable, we +get a serv->sv_lock -> softirq_ctrl.lock dependency established. Deadlock. + +Fix is to make serv->sv_lock be locked with spin_lock_bh everywhere, no +exceptions. + +[ OK ] Stopped target NFS client services. + Stopping Logout off all iSCSI sessions on shutdown... + Stopping NFS server and services... +[ 109.442380] +[ 109.442385] ====================================================== +[ 109.442386] WARNING: possible circular locking dependency detected +[ 109.442387] 5.10.16-rt30 #1 Not tainted +[ 109.442389] ------------------------------------------------------ +[ 109.442390] nfsd/1032 is trying to acquire lock: +[ 109.442392] ffff994237617f60 ((softirq_ctrl.lock).lock){+.+.}-{2:2}, at: __local_bh_disable_ip+0xd9/0x270 +[ 109.442405] +[ 109.442405] but task is already holding lock: +[ 109.442406] ffff994245cb00b0 (&serv->sv_lock){+.+.}-{0:0}, at: svc_close_list+0x1f/0x90 +[ 109.442415] +[ 109.442415] which lock already depends on the new lock. +[ 109.442415] +[ 109.442416] +[ 109.442416] the existing dependency chain (in reverse order) is: +[ 109.442417] +[ 109.442417] -> #1 (&serv->sv_lock){+.+.}-{0:0}: +[ 109.442421] rt_spin_lock+0x2b/0xc0 +[ 109.442428] svc_add_new_perm_xprt+0x42/0xa0 +[ 109.442430] svc_addsock+0x135/0x220 +[ 109.442434] write_ports+0x4b3/0x620 +[ 109.442438] nfsctl_transaction_write+0x45/0x80 +[ 109.442440] vfs_write+0xff/0x420 +[ 109.442444] ksys_write+0x4f/0xc0 +[ 109.442446] do_syscall_64+0x33/0x40 +[ 109.442450] entry_SYSCALL_64_after_hwframe+0x44/0xa9 +[ 109.442454] +[ 109.442454] -> #0 ((softirq_ctrl.lock).lock){+.+.}-{2:2}: +[ 109.442457] __lock_acquire+0x1264/0x20b0 +[ 109.442463] lock_acquire+0xc2/0x400 +[ 109.442466] rt_spin_lock+0x2b/0xc0 +[ 109.442469] __local_bh_disable_ip+0xd9/0x270 +[ 109.442471] svc_xprt_do_enqueue+0xc0/0x4d0 +[ 109.442474] svc_close_list+0x60/0x90 +[ 109.442476] svc_close_net+0x49/0x1a0 +[ 109.442478] svc_shutdown_net+0x12/0x40 +[ 109.442480] nfsd_destroy+0xc5/0x180 +[ 109.442482] nfsd+0x1bc/0x270 +[ 109.442483] kthread+0x194/0x1b0 +[ 109.442487] ret_from_fork+0x22/0x30 +[ 109.442492] +[ 109.442492] other info that might help us debug this: +[ 109.442492] +[ 109.442493] Possible unsafe locking scenario: +[ 109.442493] +[ 109.442493] CPU0 CPU1 +[ 109.442494] ---- ---- +[ 109.442495] lock(&serv->sv_lock); +[ 109.442496] lock((softirq_ctrl.lock).lock); +[ 109.442498] lock(&serv->sv_lock); +[ 109.442499] lock((softirq_ctrl.lock).lock); +[ 109.442501] +[ 109.442501] *** DEADLOCK *** +[ 109.442501] +[ 109.442501] 3 locks held by nfsd/1032: +[ 109.442503] #0: ffffffff93b49258 (nfsd_mutex){+.+.}-{3:3}, at: nfsd+0x19a/0x270 +[ 109.442508] #1: ffff994245cb00b0 (&serv->sv_lock){+.+.}-{0:0}, at: svc_close_list+0x1f/0x90 +[ 109.442512] #2: ffffffff93a81b20 (rcu_read_lock){....}-{1:2}, at: rt_spin_lock+0x5/0xc0 +[ 109.442518] +[ 109.442518] stack backtrace: +[ 109.442519] CPU: 0 PID: 1032 Comm: nfsd Not tainted 5.10.16-rt30 #1 +[ 109.442522] Hardware name: Supermicro X9DRL-3F/iF/X9DRL-3F/iF, BIOS 3.2 09/22/2015 +[ 109.442524] Call Trace: +[ 109.442527] dump_stack+0x77/0x97 +[ 109.442533] check_noncircular+0xdc/0xf0 +[ 109.442546] __lock_acquire+0x1264/0x20b0 +[ 109.442553] lock_acquire+0xc2/0x400 +[ 109.442564] rt_spin_lock+0x2b/0xc0 +[ 109.442570] __local_bh_disable_ip+0xd9/0x270 +[ 109.442573] svc_xprt_do_enqueue+0xc0/0x4d0 +[ 109.442577] svc_close_list+0x60/0x90 +[ 109.442581] svc_close_net+0x49/0x1a0 +[ 109.442585] svc_shutdown_net+0x12/0x40 +[ 109.442588] nfsd_destroy+0xc5/0x180 +[ 109.442590] nfsd+0x1bc/0x270 +[ 109.442595] kthread+0x194/0x1b0 +[ 109.442600] ret_from_fork+0x22/0x30 +[ 109.518225] nfsd: last server has exited, flushing export cache +[ OK ] Stopped NFSv4 ID-name mapping service. +[ OK ] Stopped GSSAPI Proxy Daemon. +[ OK ] Stopped NFS Mount Daemon. +[ OK ] Stopped NFS status monitor for NFSv2/3 locking.. + +Fixes: 719f8bcc883e ("svcrpc: fix xpt_list traversal locking on shutdown") +Signed-off-by: Joe Korty +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + net/sunrpc/svc_xprt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/sunrpc/svc_xprt.c ++++ b/net/sunrpc/svc_xprt.c +@@ -1072,7 +1072,7 @@ static int svc_close_list(struct svc_ser + struct svc_xprt *xprt; + int ret = 0; + +- spin_lock(&serv->sv_lock); ++ spin_lock_bh(&serv->sv_lock); + list_for_each_entry(xprt, xprt_list, xpt_list) { + if (xprt->xpt_net != net) + continue; +@@ -1080,7 +1080,7 @@ static int svc_close_list(struct svc_ser + set_bit(XPT_CLOSE, &xprt->xpt_flags); + svc_xprt_enqueue(xprt); + } +- spin_unlock(&serv->sv_lock); ++ spin_unlock_bh(&serv->sv_lock); + return ret; + } + diff --git a/queue-5.4/nvme-fix-write-zeroes-limitations.patch b/queue-5.4/nvme-fix-write-zeroes-limitations.patch new file mode 100644 index 00000000000..82a787eb89f --- /dev/null +++ b/queue-5.4/nvme-fix-write-zeroes-limitations.patch @@ -0,0 +1,77 @@ +From b94e8cd2e6a94fc7563529ddc82726a7e77e04de Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Mon, 15 Mar 2021 10:32:07 +0100 +Subject: nvme: fix Write Zeroes limitations + +From: Christoph Hellwig + +commit b94e8cd2e6a94fc7563529ddc82726a7e77e04de upstream. + +We voluntarily limit the Write Zeroes sizes to the MDTS value provided by +the hardware, but currently get the units wrong, so fix that. + +Fixes: 6e02318eaea5 ("nvme: add support for the Write Zeroes command") +Signed-off-by: Christoph Hellwig +Reviewed-by: Keith Busch +Tested-by: Klaus Jensen +Reviewed-by: Klaus Jensen +Reviewed-by: Chaitanya Kulkarni +Reviewed-by: Himanshu Madhani +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/core.c | 36 ++++++++++++------------------------ + 1 file changed, 12 insertions(+), 24 deletions(-) + +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -1743,30 +1743,18 @@ static void nvme_config_discard(struct g + blk_queue_max_write_zeroes_sectors(queue, UINT_MAX); + } + +-static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns) ++/* ++ * Even though NVMe spec explicitly states that MDTS is not applicable to the ++ * write-zeroes, we are cautious and limit the size to the controllers ++ * max_hw_sectors value, which is based on the MDTS field and possibly other ++ * limiting factors. ++ */ ++static void nvme_config_write_zeroes(struct request_queue *q, ++ struct nvme_ctrl *ctrl) + { +- u64 max_blocks; +- +- if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) || +- (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) +- return; +- /* +- * Even though NVMe spec explicitly states that MDTS is not +- * applicable to the write-zeroes:- "The restriction does not apply to +- * commands that do not transfer data between the host and the +- * controller (e.g., Write Uncorrectable ro Write Zeroes command).". +- * In order to be more cautious use controller's max_hw_sectors value +- * to configure the maximum sectors for the write-zeroes which is +- * configured based on the controller's MDTS field in the +- * nvme_init_identify() if available. +- */ +- if (ns->ctrl->max_hw_sectors == UINT_MAX) +- max_blocks = (u64)USHRT_MAX + 1; +- else +- max_blocks = ns->ctrl->max_hw_sectors + 1; +- +- blk_queue_max_write_zeroes_sectors(disk->queue, +- nvme_lba_to_sect(ns, max_blocks)); ++ if ((ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) && ++ !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) ++ blk_queue_max_write_zeroes_sectors(q, ctrl->max_hw_sectors); + } + + static int nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid, +@@ -1853,7 +1841,7 @@ static void nvme_update_disk_info(struct + set_capacity(disk, capacity); + + nvme_config_discard(disk, ns); +- nvme_config_write_zeroes(disk, ns); ++ nvme_config_write_zeroes(disk->queue, ns->ctrl); + + if (id->nsattr & (1 << 0)) + set_disk_ro(disk, true); diff --git a/queue-5.4/nvme-tcp-fix-a-null-deref-when-receiving-a-0-length-r2t-pdu.patch b/queue-5.4/nvme-tcp-fix-a-null-deref-when-receiving-a-0-length-r2t-pdu.patch new file mode 100644 index 00000000000..49cca2eeb99 --- /dev/null +++ b/queue-5.4/nvme-tcp-fix-a-null-deref-when-receiving-a-0-length-r2t-pdu.patch @@ -0,0 +1,39 @@ +From fd0823f405090f9f410fc3e3ff7efb52e7b486fa Mon Sep 17 00:00:00 2001 +From: Sagi Grimberg +Date: Mon, 15 Mar 2021 14:08:11 -0700 +Subject: nvme-tcp: fix a NULL deref when receiving a 0-length r2t PDU + +From: Sagi Grimberg + +commit fd0823f405090f9f410fc3e3ff7efb52e7b486fa upstream. + +When the controller sends us a 0-length r2t PDU we should not attempt to +try to set up a h2cdata PDU but rather conclude that this is a buggy +controller (forward progress is not possible) and simply fail it +immediately. + +Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") +Reported-by: Belanger, Martin +Signed-off-by: Sagi Grimberg +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/tcp.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/nvme/host/tcp.c ++++ b/drivers/nvme/host/tcp.c +@@ -512,6 +512,13 @@ static int nvme_tcp_setup_h2c_data_pdu(s + req->pdu_len = le32_to_cpu(pdu->r2t_length); + req->pdu_sent = 0; + ++ if (unlikely(!req->pdu_len)) { ++ dev_err(queue->ctrl->ctrl.device, ++ "req %d r2t len is %u, probably a bug...\n", ++ rq->tag, req->pdu_len); ++ return -EPROTO; ++ } ++ + if (unlikely(req->data_sent + req->pdu_len > req->data_len)) { + dev_err(queue->ctrl->ctrl.device, + "req %d r2t len %u exceeded data len %u (%zu sent)\n", diff --git a/queue-5.4/nvme-tcp-fix-possible-hang-when-failing-to-set-io-queues.patch b/queue-5.4/nvme-tcp-fix-possible-hang-when-failing-to-set-io-queues.patch new file mode 100644 index 00000000000..a03e6950356 --- /dev/null +++ b/queue-5.4/nvme-tcp-fix-possible-hang-when-failing-to-set-io-queues.patch @@ -0,0 +1,39 @@ +From 72f572428b83d0bc7028e7c4326d1a5f45205e44 Mon Sep 17 00:00:00 2001 +From: Sagi Grimberg +Date: Mon, 15 Mar 2021 14:04:26 -0700 +Subject: nvme-tcp: fix possible hang when failing to set io queues + +From: Sagi Grimberg + +commit 72f572428b83d0bc7028e7c4326d1a5f45205e44 upstream. + +We only setup io queues for nvme controllers, and it makes absolutely no +sense to allow a controller (re)connect without any I/O queues. If we +happen to fail setting the queue count for any reason, we should not +allow this to be a successful reconnect as I/O has no chance in going +through. Instead just fail and schedule another reconnect. + +Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") +Signed-off-by: Sagi Grimberg +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/tcp.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/nvme/host/tcp.c ++++ b/drivers/nvme/host/tcp.c +@@ -1643,8 +1643,11 @@ static int nvme_tcp_alloc_io_queues(stru + return ret; + + ctrl->queue_count = nr_io_queues + 1; +- if (ctrl->queue_count < 2) +- return 0; ++ if (ctrl->queue_count < 2) { ++ dev_err(ctrl->device, ++ "unable to set any I/O queues\n"); ++ return -ENOMEM; ++ } + + dev_info(ctrl->device, + "creating %d I/O queues.\n", nr_io_queues); diff --git a/queue-5.4/nvmet-don-t-check-iosqes-iocqes-for-discovery-controllers.patch b/queue-5.4/nvmet-don-t-check-iosqes-iocqes-for-discovery-controllers.patch new file mode 100644 index 00000000000..4d492e096fd --- /dev/null +++ b/queue-5.4/nvmet-don-t-check-iosqes-iocqes-for-discovery-controllers.patch @@ -0,0 +1,57 @@ +From d218a8a3003e84ab136e69a4e30dd4ec7dab2d22 Mon Sep 17 00:00:00 2001 +From: Sagi Grimberg +Date: Mon, 15 Mar 2021 15:34:51 -0700 +Subject: nvmet: don't check iosqes,iocqes for discovery controllers + +From: Sagi Grimberg + +commit d218a8a3003e84ab136e69a4e30dd4ec7dab2d22 upstream. + +From the base spec, Figure 78: + + "Controller Configuration, these fields are defined as parameters to + configure an "I/O Controller (IOC)" and not to configure a "Discovery + Controller (DC). + + ... + If the controller does not support I/O queues, then this field shall + be read-only with a value of 0h + +Just perform this check for I/O controllers. + +Fixes: a07b4970f464 ("nvmet: add a generic NVMe target") +Reported-by: Belanger, Martin +Signed-off-by: Sagi Grimberg +Reviewed-by: Chaitanya Kulkarni +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/target/core.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +--- a/drivers/nvme/target/core.c ++++ b/drivers/nvme/target/core.c +@@ -1031,9 +1031,20 @@ static void nvmet_start_ctrl(struct nvme + { + lockdep_assert_held(&ctrl->lock); + +- if (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES || +- nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES || +- nvmet_cc_mps(ctrl->cc) != 0 || ++ /* ++ * Only I/O controllers should verify iosqes,iocqes. ++ * Strictly speaking, the spec says a discovery controller ++ * should verify iosqes,iocqes are zeroed, however that ++ * would break backwards compatibility, so don't enforce it. ++ */ ++ if (ctrl->subsys->type != NVME_NQN_DISC && ++ (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES || ++ nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES)) { ++ ctrl->csts = NVME_CSTS_CFS; ++ return; ++ } ++ ++ if (nvmet_cc_mps(ctrl->cc) != 0 || + nvmet_cc_ams(ctrl->cc) != 0 || + nvmet_cc_css(ctrl->cc) != 0) { + ctrl->csts = NVME_CSTS_CFS; diff --git a/queue-5.4/series b/queue-5.4/series index 88f6a9b346a..e37baf78df8 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -10,3 +10,17 @@ arm-9030-1-entry-omit-fp-emulation-for-und-exceptions-taken-in-kernel-mode.patch arm-9044-1-vfp-use-undef-hook-for-vfp-support-detection.patch btrfs-fix-race-when-cloning-extent-buffer-during-rewind-of-an-old-root.patch btrfs-fix-slab-cache-flags-for-free-space-tree-bitmap.patch +asoc-fsl_ssi-fix-tdm-slot-setup-for-i2s-mode.patch +asoc-sof-intel-unregister-dmic-device-on-probe-error.patch +asoc-sof-intel-fix-wrong-poll-bits-in-dsp-power-down.patch +asoc-simple-card-utils-do-not-handle-device-clock.patch +afs-stop-listxattr-from-listing-afs.-attributes.patch +nvme-fix-write-zeroes-limitations.patch +nvme-tcp-fix-possible-hang-when-failing-to-set-io-queues.patch +nvme-tcp-fix-a-null-deref-when-receiving-a-0-length-r2t-pdu.patch +nvmet-don-t-check-iosqes-iocqes-for-discovery-controllers.patch +nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch +nfsd-repair-misuse-of-sv_lock-in-5.10.16-rt30.patch +svcrdma-disable-timeouts-on-rdma-backchannel.patch +vfio-iommu_api-should-be-selected.patch +sunrpc-fix-refcount-leak-for-rpc-auth-modules.patch diff --git a/queue-5.4/sunrpc-fix-refcount-leak-for-rpc-auth-modules.patch b/queue-5.4/sunrpc-fix-refcount-leak-for-rpc-auth-modules.patch new file mode 100644 index 00000000000..cb21bf02561 --- /dev/null +++ b/queue-5.4/sunrpc-fix-refcount-leak-for-rpc-auth-modules.patch @@ -0,0 +1,53 @@ +From f1442d6349a2e7bb7a6134791bdc26cb776c79af Mon Sep 17 00:00:00 2001 +From: Daniel Kobras +Date: Sat, 27 Feb 2021 00:04:37 +0100 +Subject: sunrpc: fix refcount leak for rpc auth modules + +From: Daniel Kobras + +commit f1442d6349a2e7bb7a6134791bdc26cb776c79af upstream. + +If an auth module's accept op returns SVC_CLOSE, svc_process_common() +enters a call path that does not call svc_authorise() before leaving the +function, and thus leaks a reference on the auth module's refcount. Hence, +make sure calls to svc_authenticate() and svc_authorise() are paired for +all call paths, to make sure rpc auth modules can be unloaded. + +Signed-off-by: Daniel Kobras +Fixes: 4d712ef1db05 ("svcauth_gss: Close connection when dropping an incoming message") +Link: https://lore.kernel.org/linux-nfs/3F1B347F-B809-478F-A1E9-0BE98E22B0F0@oracle.com/T/#t +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + net/sunrpc/svc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/net/sunrpc/svc.c ++++ b/net/sunrpc/svc.c +@@ -1417,7 +1417,7 @@ svc_process_common(struct svc_rqst *rqst + + sendit: + if (svc_authorise(rqstp)) +- goto close; ++ goto close_xprt; + return 1; /* Caller can now send it */ + + release_dropit: +@@ -1429,6 +1429,8 @@ release_dropit: + return 0; + + close: ++ svc_authorise(rqstp); ++close_xprt: + if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) + svc_close_xprt(rqstp->rq_xprt); + dprintk("svc: svc_process close\n"); +@@ -1437,7 +1439,7 @@ release_dropit: + err_short_len: + svc_printk(rqstp, "short len %zd, dropping request\n", + argv->iov_len); +- goto close; ++ goto close_xprt; + + err_bad_rpc: + serv->sv_stats->rpcbadfmt++; diff --git a/queue-5.4/svcrdma-disable-timeouts-on-rdma-backchannel.patch b/queue-5.4/svcrdma-disable-timeouts-on-rdma-backchannel.patch new file mode 100644 index 00000000000..830a090d5e7 --- /dev/null +++ b/queue-5.4/svcrdma-disable-timeouts-on-rdma-backchannel.patch @@ -0,0 +1,38 @@ +From 6820bf77864d5894ff67b5c00d7dba8f92011e3d Mon Sep 17 00:00:00 2001 +From: Timo Rothenpieler +Date: Tue, 23 Feb 2021 00:36:19 +0100 +Subject: svcrdma: disable timeouts on rdma backchannel + +From: Timo Rothenpieler + +commit 6820bf77864d5894ff67b5c00d7dba8f92011e3d upstream. + +This brings it in line with the regular tcp backchannel, which also has +all those timeouts disabled. + +Prevents the backchannel from timing out, getting some async operations +like server side copying getting stuck indefinitely on the client side. + +Signed-off-by: Timo Rothenpieler +Fixes: 5d252f90a800 ("svcrdma: Add class for RDMA backwards direction transport") +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c ++++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c +@@ -285,9 +285,9 @@ xprt_setup_rdma_bc(struct xprt_create *a + xprt->timeout = &xprt_rdma_bc_timeout; + xprt_set_bound(xprt); + xprt_set_connected(xprt); +- xprt->bind_timeout = RPCRDMA_BIND_TO; +- xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO; +- xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO; ++ xprt->bind_timeout = 0; ++ xprt->reestablish_timeout = 0; ++ xprt->idle_timeout = 0; + + xprt->prot = XPRT_TRANSPORT_BC_RDMA; + xprt->ops = &xprt_rdma_bc_procs; diff --git a/queue-5.4/vfio-iommu_api-should-be-selected.patch b/queue-5.4/vfio-iommu_api-should-be-selected.patch new file mode 100644 index 00000000000..3e414060c24 --- /dev/null +++ b/queue-5.4/vfio-iommu_api-should-be-selected.patch @@ -0,0 +1,35 @@ +From 179209fa12709a3df8888c323b37315da2683c24 Mon Sep 17 00:00:00 2001 +From: Jason Gunthorpe +Date: Tue, 23 Feb 2021 15:17:46 -0400 +Subject: vfio: IOMMU_API should be selected + +From: Jason Gunthorpe + +commit 179209fa12709a3df8888c323b37315da2683c24 upstream. + +As IOMMU_API is a kconfig without a description (eg does not show in the +menu) the correct operator is select not 'depends on'. Using 'depends on' +for this kind of symbol means VFIO is not selectable unless some other +random kconfig has already enabled IOMMU_API for it. + +Fixes: cba3345cc494 ("vfio: VFIO core") +Signed-off-by: Jason Gunthorpe +Message-Id: <1-v1-df057e0f92c3+91-vfio_arm_compile_test_jgg@nvidia.com> +Reviewed-by: Eric Auger +Signed-off-by: Alex Williamson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/vfio/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/vfio/Kconfig ++++ b/drivers/vfio/Kconfig +@@ -21,7 +21,7 @@ config VFIO_VIRQFD + + menuconfig VFIO + tristate "VFIO Non-Privileged userspace driver framework" +- depends on IOMMU_API ++ select IOMMU_API + select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64) + help + VFIO provides a framework for secure userspace device drivers.