Commit 37941ea1 authored by Long Li's avatar Long Li Committed by Steve French
Browse files

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: default avatarLong Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent b7a55bbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);