From ed6a8ac7103243c631284c3524c5de05f3de743a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 21 Aug 2022 15:56:12 +0200 Subject: [PATCH] 4.19-stable patches added patches: alsa-info-fix-llseek-return-value-when-using-callback.patch ata-libata-eh-add-missing-command-name.patch btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch rds-add-missing-barrier-to-release_refill.patch --- ...eek-return-value-when-using-callback.patch | 55 +++++++++++++++++++ ...a-libata-eh-add-missing-command-name.patch | 31 +++++++++++ ...ooking-up-extended-ref-on-log-replay.patch | 43 +++++++++++++++ ...-error-handling-path-in-pxamci_probe.patch | 35 ++++++++++++ ...-error-handling-path-in-pxamci_probe.patch | 35 ++++++++++++ ...dd-missing-barrier-to-release_refill.patch | 33 +++++++++++ queue-4.19/series | 6 ++ 7 files changed, 238 insertions(+) create mode 100644 queue-4.19/alsa-info-fix-llseek-return-value-when-using-callback.patch create mode 100644 queue-4.19/ata-libata-eh-add-missing-command-name.patch create mode 100644 queue-4.19/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch create mode 100644 queue-4.19/mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch create mode 100644 queue-4.19/mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch create mode 100644 queue-4.19/rds-add-missing-barrier-to-release_refill.patch diff --git a/queue-4.19/alsa-info-fix-llseek-return-value-when-using-callback.patch b/queue-4.19/alsa-info-fix-llseek-return-value-when-using-callback.patch new file mode 100644 index 00000000000..d9fcb1bfbd9 --- /dev/null +++ b/queue-4.19/alsa-info-fix-llseek-return-value-when-using-callback.patch @@ -0,0 +1,55 @@ +From 9be080edcca330be4af06b19916c35227891e8bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= + +Date: Wed, 17 Aug 2022 14:49:24 +0200 +Subject: ALSA: info: Fix llseek return value when using callback +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Amadeusz Sławiński + +commit 9be080edcca330be4af06b19916c35227891e8bc upstream. + +When using callback there was a flow of + + ret = -EINVAL + if (callback) { + offset = callback(); + goto out; + } + ... + offset = some other value in case of no callback; + ret = offset; +out: + return ret; + +which causes the snd_info_entry_llseek() to return -EINVAL when there is +callback handler. Fix this by setting "ret" directly to callback return +value before jumping to "out". + +Fixes: 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode") +Signed-off-by: Amadeusz Sławiński +Cc: +Link: https://lore.kernel.org/r/20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/info.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/core/info.c ++++ b/sound/core/info.c +@@ -127,9 +127,9 @@ static loff_t snd_info_entry_llseek(stru + entry = data->entry; + mutex_lock(&entry->access); + if (entry->c.ops->llseek) { +- offset = entry->c.ops->llseek(entry, +- data->file_private_data, +- file, offset, orig); ++ ret = entry->c.ops->llseek(entry, ++ data->file_private_data, ++ file, offset, orig); + goto out; + } + diff --git a/queue-4.19/ata-libata-eh-add-missing-command-name.patch b/queue-4.19/ata-libata-eh-add-missing-command-name.patch new file mode 100644 index 00000000000..1a76b07fa8b --- /dev/null +++ b/queue-4.19/ata-libata-eh-add-missing-command-name.patch @@ -0,0 +1,31 @@ +From d3122bf9aa4c974f5e2c0112f799757b3a2779da Mon Sep 17 00:00:00 2001 +From: Damien Le Moal +Date: Fri, 12 Aug 2022 02:29:53 +0900 +Subject: ata: libata-eh: Add missing command name + +From: Damien Le Moal + +commit d3122bf9aa4c974f5e2c0112f799757b3a2779da upstream. + +Add the missing command name for ATA_CMD_NCQ_NON_DATA to +ata_get_cmd_name(). + +Fixes: 661ce1f0c4a6 ("libata/libsas: Define ATA_CMD_NCQ_NON_DATA") +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Reviewed-by: Hannes Reinecke +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/libata-eh.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/ata/libata-eh.c ++++ b/drivers/ata/libata-eh.c +@@ -2350,6 +2350,7 @@ const char *ata_get_cmd_descript(u8 comm + { ATA_CMD_WRITE_QUEUED_FUA_EXT, "WRITE DMA QUEUED FUA EXT" }, + { ATA_CMD_FPDMA_READ, "READ FPDMA QUEUED" }, + { ATA_CMD_FPDMA_WRITE, "WRITE FPDMA QUEUED" }, ++ { ATA_CMD_NCQ_NON_DATA, "NCQ NON-DATA" }, + { ATA_CMD_FPDMA_SEND, "SEND FPDMA QUEUED" }, + { ATA_CMD_FPDMA_RECV, "RECEIVE FPDMA QUEUED" }, + { ATA_CMD_PIO_READ, "READ SECTOR(S)" }, diff --git a/queue-4.19/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch b/queue-4.19/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch new file mode 100644 index 00000000000..ee681a662a7 --- /dev/null +++ b/queue-4.19/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch @@ -0,0 +1,43 @@ +From 7a6b75b79902e47f46328b57733f2604774fa2d9 Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Mon, 1 Aug 2022 14:57:51 +0100 +Subject: btrfs: fix lost error handling when looking up extended ref on log replay + +From: Filipe Manana + +commit 7a6b75b79902e47f46328b57733f2604774fa2d9 upstream. + +During log replay, when processing inode references, if we get an error +when looking up for an extended reference at __add_inode_ref(), we ignore +it and proceed, returning success (0) if no other error happens after the +lookup. This is obviously wrong because in case an extended reference +exists and it encodes some name not in the log, we need to unlink it, +otherwise the filesystem state will not match the state it had after the +last fsync. + +So just make __add_inode_ref() return an error it gets from the extended +reference lookup. + +Fixes: f186373fef005c ("btrfs: extended inode refs") +CC: stable@vger.kernel.org # 4.9+ +Signed-off-by: Filipe Manana +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/tree-log.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/tree-log.c ++++ b/fs/btrfs/tree-log.c +@@ -1081,7 +1081,9 @@ again: + extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen, + inode_objectid, parent_objectid, 0, + 0); +- if (!IS_ERR_OR_NULL(extref)) { ++ if (IS_ERR(extref)) { ++ return PTR_ERR(extref); ++ } else if (extref) { + u32 item_size; + u32 cur_offset = 0; + unsigned long base; diff --git a/queue-4.19/mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch b/queue-4.19/mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch new file mode 100644 index 00000000000..95107396f75 --- /dev/null +++ b/queue-4.19/mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch @@ -0,0 +1,35 @@ +From 98d7c5e5792b8ce3e1352196dac7f404bb1b46ec Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Tue, 26 Jul 2022 21:15:43 +0200 +Subject: mmc: pxamci: Fix an error handling path in pxamci_probe() + +From: Christophe JAILLET + +commit 98d7c5e5792b8ce3e1352196dac7f404bb1b46ec upstream. + +The commit in Fixes: has moved some code around without updating gotos to +the error handling path. + +Update it now and release some resources if pxamci_of_init() fails. + +Fixes: fa3a5115469c ("mmc: pxamci: call mmc_of_parse()") +Signed-off-by: Christophe JAILLET +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/6d75855ad4e2470e9ed99e0df21bc30f0c925a29.1658862932.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/pxamci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/host/pxamci.c ++++ b/drivers/mmc/host/pxamci.c +@@ -653,7 +653,7 @@ static int pxamci_probe(struct platform_ + + ret = pxamci_of_init(pdev, mmc); + if (ret) +- return ret; ++ goto out; + + host = mmc_priv(mmc); + host->mmc = mmc; diff --git a/queue-4.19/mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch b/queue-4.19/mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch new file mode 100644 index 00000000000..ba4f013cb29 --- /dev/null +++ b/queue-4.19/mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch @@ -0,0 +1,35 @@ +From b886f54c300d31c109d2e4336b22922b64e7ba7d Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Tue, 26 Jul 2022 21:15:51 +0200 +Subject: mmc: pxamci: Fix another error handling path in pxamci_probe() + +From: Christophe JAILLET + +commit b886f54c300d31c109d2e4336b22922b64e7ba7d upstream. + +The commit in Fixes: has introduced an new error handling without branching +to the existing error handling path. + +Update it now and release some resources if pxamci_init_ocr() fails. + +Fixes: 61951fd6cb49 ("mmc: pxamci: let mmc core handle regulators") +Signed-off-by: Christophe JAILLET +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/07a2dcebf8ede69b484103de8f9df043f158cffd.1658862932.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/pxamci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/host/pxamci.c ++++ b/drivers/mmc/host/pxamci.c +@@ -677,7 +677,7 @@ static int pxamci_probe(struct platform_ + + ret = pxamci_init_ocr(host); + if (ret < 0) +- return ret; ++ goto out; + + mmc->caps = 0; + host->cmdat = 0; diff --git a/queue-4.19/rds-add-missing-barrier-to-release_refill.patch b/queue-4.19/rds-add-missing-barrier-to-release_refill.patch new file mode 100644 index 00000000000..32a8f49502f --- /dev/null +++ b/queue-4.19/rds-add-missing-barrier-to-release_refill.patch @@ -0,0 +1,33 @@ +From 9f414eb409daf4f778f011cf8266d36896bb930b Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Wed, 10 Aug 2022 09:00:42 -0400 +Subject: rds: add missing barrier to release_refill + +From: Mikulas Patocka + +commit 9f414eb409daf4f778f011cf8266d36896bb930b upstream. + +The functions clear_bit and set_bit do not imply a memory barrier, thus it +may be possible that the waitqueue_active function (which does not take +any locks) is moved before clear_bit and it could miss a wakeup event. + +Fix this bug by adding a memory barrier after clear_bit. + +Signed-off-by: Mikulas Patocka +Cc: stable@vger.kernel.org +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/rds/ib_recv.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/rds/ib_recv.c ++++ b/net/rds/ib_recv.c +@@ -362,6 +362,7 @@ static int acquire_refill(struct rds_con + static void release_refill(struct rds_connection *conn) + { + clear_bit(RDS_RECV_REFILL, &conn->c_flags); ++ smp_mb__after_atomic(); + + /* We don't use wait_on_bit()/wake_up_bit() because our waking is in a + * hot path and finding waiters is very rare. We don't want to walk diff --git a/queue-4.19/series b/queue-4.19/series index 534b71afc69..48b65766581 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -212,3 +212,9 @@ net_sched-cls_route-disallow-handle-of-0.patch firmware-arm_scpi-ensure-scpi_info-is-not-assigned-if-the-probe-fails.patch powerpc-mm-split-dump_pagelinuxtables-flag_array-table.patch powerpc-ptdump-fix-display-of-rw-pages-on-fsl_book3e.patch +alsa-info-fix-llseek-return-value-when-using-callback.patch +rds-add-missing-barrier-to-release_refill.patch +ata-libata-eh-add-missing-command-name.patch +mmc-pxamci-fix-another-error-handling-path-in-pxamci_probe.patch +mmc-pxamci-fix-an-error-handling-path-in-pxamci_probe.patch +btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch -- 2.47.3