From: Greg Kroah-Hartman Date: Thu, 13 Feb 2020 01:47:22 +0000 (-0800) Subject: Merge branch 'master' of gitolite.kernel.org:/pub/scm/linux/kernel/git/stable/stable... X-Git-Tag: v4.4.214~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4e49ec682cd72abe10ae4daaed02f9012a01495;p=thirdparty%2Fkernel%2Fstable-queue.git Merge branch 'master' of gitolite.kernel.org:/pub/scm/linux/kernel/git/stable/stable-queue --- b4e49ec682cd72abe10ae4daaed02f9012a01495 diff --cc queue-4.14/nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch index 94283ef259d,00000000000..e992cfe2353 mode 100644,000000..100644 --- a/queue-4.14/nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch +++ b/queue-4.14/nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch @@@ -1,118 -1,0 +1,118 @@@ +From 221203ce6406273cf00e5c6397257d986c003ee6 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 6 Jan 2020 15:25:04 -0500 +Subject: NFS/pnfs: Fix pnfs_generic_prepare_to_resend_writes() + +From: Trond Myklebust + +commit 221203ce6406273cf00e5c6397257d986c003ee6 upstream. + +Instead of making assumptions about the commit verifier contents, change +the commit code to ensure we always check that the verifier was set +by the XDR code. + +Fixes: f54bcf2ecee9 ("pnfs: Prepare for flexfiles by pulling out common code") +Signed-off-by: Trond Myklebust +Signed-off-by: Anna Schumaker +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/direct.c | 4 ++-- + fs/nfs/nfs3xdr.c | 5 ++++- + fs/nfs/nfs4xdr.c | 5 ++++- + fs/nfs/pnfs_nfs.c | 7 +++---- + fs/nfs/write.c | 4 +++- + 5 files changed, 16 insertions(+), 9 deletions(-) + +--- a/fs/nfs/direct.c ++++ b/fs/nfs/direct.c +@@ -261,10 +261,10 @@ static int nfs_direct_cmp_commit_data_ve + data->ds_commit_index); + + /* verifier not set so always fail */ +- if (verfp->committed < 0) ++ if (verfp->committed < 0 || data->res.verf->committed <= NFS_UNSTABLE) + return 1; + +- return nfs_direct_cmp_verf(verfp, &data->verf); ++ return nfs_direct_cmp_verf(verfp, data->res.verf); + } + + /** +--- a/fs/nfs/nfs3xdr.c ++++ b/fs/nfs/nfs3xdr.c +@@ -2373,6 +2373,7 @@ static int nfs3_xdr_dec_commit3res(struc + void *data) + { + struct nfs_commitres *result = data; ++ struct nfs_writeverf *verf = result->verf; + enum nfs_stat status; + int error; + +@@ -2385,7 +2386,9 @@ static int nfs3_xdr_dec_commit3res(struc + result->op_status = status; + if (status != NFS3_OK) + goto out_status; +- error = decode_writeverf3(xdr, &result->verf->verifier); ++ error = decode_writeverf3(xdr, &verf->verifier); ++ if (!error) ++ verf->committed = NFS_FILE_SYNC; + out: + return error; + out_status: +--- a/fs/nfs/nfs4xdr.c ++++ b/fs/nfs/nfs4xdr.c +@@ -4409,11 +4409,14 @@ static int decode_write_verifier(struct + + static int decode_commit(struct xdr_stream *xdr, struct nfs_commitres *res) + { ++ struct nfs_writeverf *verf = res->verf; + int status; + + status = decode_op_hdr(xdr, OP_COMMIT); + if (!status) +- status = decode_write_verifier(xdr, &res->verf->verifier); ++ status = decode_write_verifier(xdr, &verf->verifier); ++ if (!status) ++ verf->committed = NFS_FILE_SYNC; + return status; + } + +--- a/fs/nfs/pnfs_nfs.c ++++ b/fs/nfs/pnfs_nfs.c +@@ -30,12 +30,11 @@ EXPORT_SYMBOL_GPL(pnfs_generic_rw_releas + /* Fake up some data that will cause nfs_commit_release to retry the writes. */ + void pnfs_generic_prepare_to_resend_writes(struct nfs_commit_data *data) + { +- struct nfs_page *first = nfs_list_entry(data->pages.next); ++ struct nfs_writeverf *verf = data->res.verf; + + data->task.tk_status = 0; +- memcpy(&data->verf.verifier, &first->wb_verf, +- sizeof(data->verf.verifier)); +- data->verf.verifier.data[0]++; /* ensure verifier mismatch */ ++ memset(&verf->verifier, 0, sizeof(verf->verifier)); ++ verf->committed = NFS_UNSTABLE; + } + EXPORT_SYMBOL_GPL(pnfs_generic_prepare_to_resend_writes); + +--- a/fs/nfs/write.c ++++ b/fs/nfs/write.c - @@ -1815,6 +1815,7 @@ static void nfs_commit_done(struct rpc_t ++@@ -1807,6 +1807,7 @@ static void nfs_commit_done(struct rpc_t + + static void nfs_commit_release_pages(struct nfs_commit_data *data) + { ++ const struct nfs_writeverf *verf = data->res.verf; + struct nfs_page *req; + int status = data->task.tk_status; + struct nfs_commit_info cinfo; - @@ -1841,7 +1842,8 @@ static void nfs_commit_release_pages(str ++@@ -1833,7 +1834,8 @@ static void nfs_commit_release_pages(str + + /* Okay, COMMIT succeeded, apparently. Check the verifier + * returned by the server against all stored verfs. */ +- if (!nfs_write_verifier_cmp(&req->wb_verf, &data->verf.verifier)) { ++ if (verf->committed > NFS_UNSTABLE && ++ !nfs_write_verifier_cmp(&req->wb_verf, &verf->verifier)) { + /* We have a match */ + if (req->wb_page) + nfs_inode_remove_request(req); diff --cc queue-4.14/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch index 00000000000,4c2cdc93a6e..9d21de234bf mode 000000,100644..100644 --- a/queue-4.14/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch +++ b/queue-4.14/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch @@@ -1,0 -1,69 +1,64 @@@ + From 28e9b4cd255e3bbb49f0dd6e1fc234e76d046c03 Mon Sep 17 00:00:00 2001 + From: Sasha Levin + Date: Mon, 10 Feb 2020 10:18:25 -0700 + Subject: serial: uartps: Add a timeout to the tx empty wait + + From: Shubhrajyoti Datta + + [ Upstream commit 277375b864e8147975b064b513f491e2a910e66a ] + + In case the cable is not connected then the target gets into + an infinite wait for tx empty. + Add a timeout to the tx empty wait. + + Reported-by: Jean-Francois Dagenais + Signed-off-by: Shubhrajyoti Datta + Signed-off-by: Greg Kroah-Hartman + Signed-off-by: Sasha Levin + --- - drivers/tty/serial/xilinx_uartps.c | 14 ++++++++++---- ++ drivers/tty/serial/xilinx_uartps.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + -diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c -index 0dbfd02e3b196..9826a15bfd871 100644 + --- a/drivers/tty/serial/xilinx_uartps.c + +++ b/drivers/tty/serial/xilinx_uartps.c + @@ -31,6 +31,7 @@ + #include + #include + #include + +#include + + #define CDNS_UART_TTY_NAME "ttyPS" + #define CDNS_UART_NAME "xuartps" + @@ -39,6 +40,7 @@ + #define CDNS_UART_NR_PORTS 2 + #define CDNS_UART_FIFO_SIZE 64 /* FIFO size */ + #define CDNS_UART_REGISTER_SPACE 0x1000 + +#define TX_TIMEOUT 500000 + + /* Rx Trigger level */ + static int rx_trigger_level = 56; -@@ -685,16 +687,20 @@ static void cdns_uart_set_termios(struct uart_port *port, ++@@ -685,16 +687,20 @@ static void cdns_uart_set_termios(struct + unsigned int cval = 0; + unsigned int baud, minbaud, maxbaud; + unsigned long flags; + - unsigned int ctrl_reg, mode_reg; + + unsigned int ctrl_reg, mode_reg, val; + + int err; + + spin_lock_irqsave(&port->lock, flags); + + /* Wait for the transmit FIFO to empty before making changes */ + if (!(readl(port->membase + CDNS_UART_CR) & + CDNS_UART_CR_TX_DIS)) { + - while (!(readl(port->membase + CDNS_UART_SR) & + - CDNS_UART_SR_TXEMPTY)) { + - cpu_relax(); + + err = readl_poll_timeout(port->membase + CDNS_UART_SR, + + val, (val & CDNS_UART_SR_TXEMPTY), + + 1000, TX_TIMEOUT); + + if (err) { + + dev_err(port->dev, "timed out waiting for tx empty"); + + return; + } + } + --- -2.20.1 - diff --cc queue-4.14/series index 36db8b099ae,ad19021729f..8bc05191c64 --- a/queue-4.14/series +++ b/queue-4.14/series @@@ -140,11 -140,4 +140,11 @@@ perf-core-fix-mlock-accounting-in-perf_ rxrpc-fix-service-call-disconnection.patch asoc-pcm-update-fe-be-trigger-order-based-on-the-com.patch hv_sock-remove-the-accept-port-restriction.patch +rdma-netlink-do-not-always-generate-an-ack-for-some-netlink-operations.patch +scsi-ufs-fix-ufshcd_probe_hba-reture-value-in-case-ufshcd_scsi_add_wlus-fails.patch +pci-switchtec-fix-vep_vector_number-ioread-width.patch +pci-don-t-disable-bridge-bars-when-assigning-bus-resources.patch +nfs-nfs_swap-should-depend-on-swap.patch - nfs-revalidate-the-file-size-on-a-fatal-write-error.patch +nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch +nfsv4-try-lease-recovery-on-nfs4err_expired.patch + serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch diff --cc queue-4.19/series index d6d04108ec7,5ebd33fb334..bf22767d4dd --- a/queue-4.19/series +++ b/queue-4.19/series @@@ -1,15 -1,6 +1,19 @@@ asoc-pcm-update-fe-be-trigger-order-based-on-the-com.patch hv_sock-remove-the-accept-port-restriction.patch +ib-mlx4-fix-memory-leak-in-add_gid-error-flow.patch +rdma-netlink-do-not-always-generate-an-ack-for-some-netlink-operations.patch +rdma-core-fix-locking-in-ib_uverbs_event_read.patch +rdma-uverbs-verify-mr-access-flags.patch +scsi-ufs-fix-ufshcd_probe_hba-reture-value-in-case-ufshcd_scsi_add_wlus-fails.patch +pci-iov-fix-memory-leak-in-pci_iov_add_virtfn.patch +ath10k-pci-only-dump-ath10k_mem_region_type_ioreg-when-safe.patch +pci-switchtec-fix-vep_vector_number-ioread-width.patch +pci-don-t-disable-bridge-bars-when-assigning-bus-resources.patch +nfs-nfs_swap-should-depend-on-swap.patch +nfs-revalidate-the-file-size-on-a-fatal-write-error.patch +nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch +nfsv4-try-lease-recovery-on-nfs4err_expired.patch + serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch + gpio-zynq-report-gpio-direction-at-boot.patch + spi-spi-mem-add-extra-sanity-checks-on-the-op-param.patch + spi-spi-mem-fix-inverted-logic-in-op-sanity-check.patch diff --cc queue-5.4/series index 1c0169ae75a,cb12133b875..8ac4e7085ad --- a/queue-5.4/series +++ b/queue-5.4/series @@@ -1,28 -1,3 +1,29 @@@ asoc-pcm-update-fe-be-trigger-order-based-on-the-com.patch hv_sock-remove-the-accept-port-restriction.patch +ib-mlx4-fix-memory-leak-in-add_gid-error-flow.patch +ib-srp-never-use-immediate-data-if-it-is-disabled-by-a-user.patch +ib-mlx4-fix-leak-in-id_map_find_del.patch +rdma-netlink-do-not-always-generate-an-ack-for-some-netlink-operations.patch +rdma-i40iw-fix-a-potential-null-pointer-dereference.patch +rdma-core-fix-locking-in-ib_uverbs_event_read.patch +rdma-uverbs-verify-mr-access-flags.patch +rdma-cma-fix-unbalanced-cm_id-reference-count-during-address-resolve.patch +rdma-umem-fix-ib_umem_find_best_pgsz.patch +scsi-ufs-fix-ufshcd_probe_hba-reture-value-in-case-ufshcd_scsi_add_wlus-fails.patch +pci-iov-fix-memory-leak-in-pci_iov_add_virtfn.patch +ath10k-pci-only-dump-ath10k_mem_region_type_ioreg-when-safe.patch +pci-switchtec-use-dma_set_mask_and_coherent.patch +pci-switchtec-fix-vep_vector_number-ioread-width.patch +pci-tegra-fix-afi_pex2_ctrl-reg-offset-for-tegra30.patch +pci-don-t-disable-bridge-bars-when-assigning-bus-resources.patch +pci-aer-initialize-aer_fifo.patch +iwlwifi-mvm-avoid-use-after-free-for-pmsr-request.patch +nfsd-fixing-possible-null-pointer-derefering-in-copy-offload.patch +nfs-nfs_swap-should-depend-on-swap.patch +nfs-revalidate-the-file-size-on-a-fatal-write-error.patch +nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch +nfs-fix-fix-of-show_nfs_errors.patch +nfsv4-pnfs_roc-must-use-cred_fscmp-to-compare-creds.patch +nfsv4-try-lease-recovery-on-nfs4err_expired.patch +nfsv4.0-nfs4_do_fsinfo-should-not-do-implicit-lease-renewals.patch + x86-boot-handle-malformed-srat-tables-during-early-a.patch diff --cc queue-5.5/series index 971a8fdd9f0,4ed575e63a8..c9767ef54ab --- a/queue-5.5/series +++ b/queue-5.5/series @@@ -1,35 -1,1 +1,36 @@@ +ib-mlx4-fix-memory-leak-in-add_gid-error-flow.patch +ib-srp-never-use-immediate-data-if-it-is-disabled-by-a-user.patch +ib-mlx5-return-the-administrative-guid-if-exists.patch +ib-mlx4-fix-leak-in-id_map_find_del.patch +rdma-netlink-do-not-always-generate-an-ack-for-some-netlink-operations.patch +rdma-i40iw-fix-a-potential-null-pointer-dereference.patch +rdma-core-fix-locking-in-ib_uverbs_event_read.patch +rdma-uverbs-verify-mr-access-flags.patch +rdma-mlx5-fix-handling-of-iova-user_va-in-odp-paths.patch +rdma-core-ensure-that-rdma_user_mmap_entry_remove-is-a-fence.patch +rdma-cma-fix-unbalanced-cm_id-reference-count-during-address-resolve.patch +rdma-umem-fix-ib_umem_find_best_pgsz.patch +scsi-ufs-fix-ufshcd_probe_hba-reture-value-in-case-ufshcd_scsi_add_wlus-fails.patch +pci-iov-fix-memory-leak-in-pci_iov_add_virtfn.patch +ath10k-pci-only-dump-ath10k_mem_region_type_ioreg-when-safe.patch +pci-switchtec-use-dma_set_mask_and_coherent.patch +pci-switchtec-fix-vep_vector_number-ioread-width.patch +pci-tegra-fix-afi_pex2_ctrl-reg-offset-for-tegra30.patch +pci-don-t-disable-bridge-bars-when-assigning-bus-resources.patch +pci-aer-initialize-aer_fifo.patch +iwlwifi-mvm-avoid-use-after-free-for-pmsr-request.patch +iwlwifi-mvm-fix-tdls-discovery-with-the-new-firmware-api.patch +netfilter-flowtable-fetch-stats-only-if-flow-is-still-alive.patch +netfilter-flowtable-restrict-flow-dissector-match-on-meta-ingress-device.patch +netfilter-flowtable-fix-hardware-flush-order-on-nf_flow_table_cleanup.patch +netfilter-flowtable-fix-missing-flush-hardware-on-table-free.patch +nfsd-fixing-possible-null-pointer-derefering-in-copy-offload.patch +nfsv4.x-recover-from-pre-mature-loss-of-openstateid.patch +nfs-nfs_swap-should-depend-on-swap.patch +nfs-revalidate-the-file-size-on-a-fatal-write-error.patch +nfs-pnfs-fix-pnfs_generic_prepare_to_resend_writes.patch +nfs-fix-fix-of-show_nfs_errors.patch +nfsv4-pnfs_roc-must-use-cred_fscmp-to-compare-creds.patch +nfsv4-try-lease-recovery-on-nfs4err_expired.patch +nfsv4.0-nfs4_do_fsinfo-should-not-do-implicit-lease-renewals.patch + x86-boot-handle-malformed-srat-tables-during-early-a.patch