summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2019-10-16 13:51:52 -0700
committerSteve French <stfrench@microsoft.com>2019-11-25 01:14:15 -0600
commit37941ea17d3f8eb2f5ac2f59346fab9e8439271a (patch)
tree51831f91d6fd58890750e41e41621a2ac504221d /fs/cifs
parentb7a55bbd6d5402bfbadcfb3904e3c75b38ab5ba4 (diff)
cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE
While it's not friendly to fail user processes that issue more iovs than we support, at least we should return the correct error code so the user process gets a chance to retry with smaller number of iovs. Signed-off-by: Long Li <longli@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smbdirect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 3c91fa97c9a8..64c5b872220d 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1069,7 +1069,7 @@ static int smbd_post_send_data(
if (n_vec > SMBDIRECT_MAX_SGE) {
cifs_dbg(VFS, "Can't fit data to SGL, n_vec=%d\n", n_vec);
- return -ENOMEM;
+ return -EINVAL;
}
sg_init_table(sgl, n_vec);