提交 37941ea1 编写于 作者: L Long Li 提交者: Steve French

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: NLong Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 b7a55bbd
...@@ -1069,7 +1069,7 @@ static int smbd_post_send_data( ...@@ -1069,7 +1069,7 @@ static int smbd_post_send_data(
if (n_vec > SMBDIRECT_MAX_SGE) { if (n_vec > SMBDIRECT_MAX_SGE) {
cifs_dbg(VFS, "Can't fit data to SGL, n_vec=%d\n", n_vec); 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); sg_init_table(sgl, n_vec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册