mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 20:21:30 +00:00
iscsi-scst: Restore msg->msg_iov check
This commit is contained in:
@@ -697,6 +697,10 @@ static int do_recv(struct iscsi_conn *conn)
|
||||
mm_segment_t oldfs;
|
||||
struct msghdr *msg;
|
||||
int read_size;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
|
||||
struct iovec *first_iov;
|
||||
int first_len;
|
||||
#endif
|
||||
|
||||
EXTRACHECKS_BUG_ON(conn->read_cmnd == NULL);
|
||||
|
||||
@@ -717,6 +721,8 @@ restart:
|
||||
read_size = msg->msg_iter.count;
|
||||
#else
|
||||
read_size = conn->read_size;
|
||||
first_iov = msg->msg_iov;
|
||||
first_len = first_iov->iov_len;
|
||||
#endif
|
||||
|
||||
oldfs = get_fs();
|
||||
@@ -746,7 +752,7 @@ restart:
|
||||
sBUG_ON(msg->msg_iter.count + res != read_size);
|
||||
res = msg->msg_iter.count;
|
||||
#else
|
||||
/* To do: restore msg->msg_iov check. */
|
||||
sBUG_ON((res >= first_len) && (first_iov->iov_len != 0));
|
||||
conn->read_size -= res;
|
||||
res = conn->read_size;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user