From: Greg Kroah-Hartman Date: Sun, 21 Aug 2022 13:57:33 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.9.326~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad46a038747e96abe6a87faff44b81827fd79177;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-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 rds-add-missing-barrier-to-release_refill.patch --- diff --git a/queue-4.9/alsa-info-fix-llseek-return-value-when-using-callback.patch b/queue-4.9/alsa-info-fix-llseek-return-value-when-using-callback.patch new file mode 100644 index 00000000000..d9fcb1bfbd9 --- /dev/null +++ b/queue-4.9/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.9/ata-libata-eh-add-missing-command-name.patch b/queue-4.9/ata-libata-eh-add-missing-command-name.patch new file mode 100644 index 00000000000..821b96ca836 --- /dev/null +++ b/queue-4.9/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 +@@ -2439,6 +2439,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.9/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch b/queue-4.9/btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch new file mode 100644 index 00000000000..6ad1170513a --- /dev/null +++ b/queue-4.9/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 +@@ -1074,7 +1074,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.9/rds-add-missing-barrier-to-release_refill.patch b/queue-4.9/rds-add-missing-barrier-to-release_refill.patch new file mode 100644 index 00000000000..eb4729e9345 --- /dev/null +++ b/queue-4.9/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 +@@ -356,6 +356,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.9/series b/queue-4.9/series index 040179823bc..de443d54ac6 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -63,3 +63,7 @@ bluetooth-l2cap-fix-l2cap_global_chan_by_psm-regression.patch nios2-time-read-timer-in-get_cycles-only-if-initialized.patch net-9p-initialize-the-iounit-field-during-fid-creation.patch net_sched-cls_route-disallow-handle-of-0.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 +btrfs-fix-lost-error-handling-when-looking-up-extended-ref-on-log-replay.patch