1 From 8d526d62db907e786fd88948c75d1833d82bd80e Mon Sep 17 00:00:00 2001
2 From: Steve French <stfrench@microsoft.com>
3 Date: Mon, 17 Jun 2019 14:49:07 -0500
4 Subject: SMB3: retry on STATUS_INSUFFICIENT_RESOURCES instead of failing write
6 From: Steve French <stfrench@microsoft.com>
8 commit 8d526d62db907e786fd88948c75d1833d82bd80e upstream.
10 Some servers such as Windows 10 will return STATUS_INSUFFICIENT_RESOURCES
11 as the number of simultaneous SMB3 requests grows (even though the client
12 has sufficient credits). Return EAGAIN on STATUS_INSUFFICIENT_RESOURCES
13 so that we can retry writes which fail with this status code.
15 This (for example) fixes large file copies to Windows 10 on fast networks.
17 Signed-off-by: Steve French <stfrench@microsoft.com>
18 CC: Stable <stable@vger.kernel.org>
19 Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
20 Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 fs/cifs/smb2maperror.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
27 --- a/fs/cifs/smb2maperror.c
28 +++ b/fs/cifs/smb2maperror.c
29 @@ -456,7 +456,7 @@ static const struct status_to_posix_erro
30 {STATUS_FILE_INVALID, -EIO, "STATUS_FILE_INVALID"},
31 {STATUS_ALLOTTED_SPACE_EXCEEDED, -EIO,
32 "STATUS_ALLOTTED_SPACE_EXCEEDED"},
33 - {STATUS_INSUFFICIENT_RESOURCES, -EREMOTEIO,
34 + {STATUS_INSUFFICIENT_RESOURCES, -EAGAIN,
35 "STATUS_INSUFFICIENT_RESOURCES"},
36 {STATUS_DFS_EXIT_PATH_FOUND, -EIO, "STATUS_DFS_EXIT_PATH_FOUND"},
37 {STATUS_DEVICE_DATA_ERROR, -EIO, "STATUS_DEVICE_DATA_ERROR"},