Skip to content

Commit

Permalink
cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Long Li authored and Steve French committed Nov 25, 2019
1 parent b7a55bb commit 37941ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/smbdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37941ea

Please sign in to comment.