[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.16 07/31] ssh: Do not switch session to non-blocking mode
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.16 07/31] ssh: Do not switch session to non-blocking mode |
Date: |
Tue, 28 Jan 2025 00:40:59 +0300 |
The libssh does not handle non-blocking mode in SFTP correctly. The
driver code already changes the mode to blocking for the SFTP
initialization, but for some reason changes to non-blocking mode.
This used to work accidentally until libssh in 0.11 branch merged
the patch to avoid infinite looping in case of network errors:
https://gitlab.com/libssh/libssh-mirror/-/merge_requests/498
Since then, the ssh driver in qemu fails to read files over SFTP
as the first SFTP messages exchanged after switching the session
to non-blocking mode return SSH_AGAIN, but that message is lost
int the SFTP internals and interpretted as SSH_ERROR, which is
returned to the caller:
https://gitlab.com/libssh/libssh-mirror/-/issues/280
This is indeed an issue in libssh that we should address in the
long term, but it will require more work on the internals. For
now, the SFTP is not supported in non-blocking mode.
Fixes: https://gitlab.com/libssh/libssh-mirror/-/issues/280
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Message-ID: <20241113125526.2495731-1-rjones@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit fbdea3d6c13d5a75895c287a004c6f1a6bf6c164)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/block/ssh.c b/block/ssh.c
index 04726d4ecb..c90d705453 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -859,9 +859,6 @@ static int ssh_file_open(BlockDriverState *bs, QDict
*options, int bdrv_flags,
goto err;
}
- /* Go non-blocking. */
- ssh_set_blocking(s->session, 0);
-
if (s->attrs->type == SSH_FILEXFER_TYPE_REGULAR) {
bs->supported_truncate_flags = BDRV_REQ_ZERO_WRITE;
}
--
2.39.5
- [Stable-7.2.16 00/31] Patch Round-up for stable 7.2.16, freeze on 2025-02-06, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 01/31] hw/intc/openpic: Avoid taking address of out-of-bounds array index, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 02/31] bitops.h: Define bit operations on 'uint32_t' arrays, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 03/31] hw/intc/loongarch_extioi: Use set_bit32() and clear_bit32() for s->isr, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 04/31] cirrus-ci: Remove MSYS2 jobs duplicated with gitlab-ci, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 05/31] virtio-net: Fix size check in dhclient workaround, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 06/31] qdev: Fix set_pci_devfn() to visit option only once, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 07/31] ssh: Do not switch session to non-blocking mode,
Michael Tokarev <=
- [Stable-7.2.16 08/31] scsi: megasas: Internal cdbs have 16-byte length, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 09/31] tests/9p: fix Rreaddir response name, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 10/31] tests/9p: add missing Rgetattr response name, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 11/31] tests/9p: add 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 12/31] 9pfs: remove obsolete comment in v9fs_getattr(), Michael Tokarev, 2025/01/28
- [Stable-7.2.16 14/31] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 15/31] target/ppc: Fix non-maskable interrupt while halted, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 13/31] 9pfs: fix 'Tgetattr' after unlink, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 16/31] hw/openrisc/openrisc_sim: keep serial@90000000 as default, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 17/31] tcg/riscv: Fix StoreStore barrier generation, Michael Tokarev, 2025/01/28