Loading fs/ocfs2/cluster/tcp.c +8 −20 Original line number Original line Diff line number Diff line Loading @@ -940,32 +940,20 @@ static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec, size_t veclen, size_t total) size_t veclen, size_t total) { { int ret; int ret; mm_segment_t oldfs; struct msghdr msg; struct msghdr msg = { .msg_iov = (struct iovec *)vec, .msg_iovlen = veclen, }; if (sock == NULL) { if (sock == NULL) { ret = -EINVAL; ret = -EINVAL; goto out; goto out; } } oldfs = get_fs(); ret = kernel_sendmsg(sock, &msg, vec, veclen, total); set_fs(get_ds()); if (likely(ret == total)) ret = sock_sendmsg(sock, &msg, total); return 0; set_fs(oldfs); mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, total); if (ret != total) { mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, total); if (ret >= 0) if (ret >= 0) ret = -EPIPE; /* should be smarter, I bet */ ret = -EPIPE; /* should be smarter, I bet */ goto out; } ret = 0; out: out: if (ret < 0) mlog(0, "returning error: %d\n", ret); mlog(0, "returning error: %d\n", ret); return ret; return ret; } } Loading Loading
fs/ocfs2/cluster/tcp.c +8 −20 Original line number Original line Diff line number Diff line Loading @@ -940,32 +940,20 @@ static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec, size_t veclen, size_t total) size_t veclen, size_t total) { { int ret; int ret; mm_segment_t oldfs; struct msghdr msg; struct msghdr msg = { .msg_iov = (struct iovec *)vec, .msg_iovlen = veclen, }; if (sock == NULL) { if (sock == NULL) { ret = -EINVAL; ret = -EINVAL; goto out; goto out; } } oldfs = get_fs(); ret = kernel_sendmsg(sock, &msg, vec, veclen, total); set_fs(get_ds()); if (likely(ret == total)) ret = sock_sendmsg(sock, &msg, total); return 0; set_fs(oldfs); mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, total); if (ret != total) { mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, total); if (ret >= 0) if (ret >= 0) ret = -EPIPE; /* should be smarter, I bet */ ret = -EPIPE; /* should be smarter, I bet */ goto out; } ret = 0; out: out: if (ret < 0) mlog(0, "returning error: %d\n", ret); mlog(0, "returning error: %d\n", ret); return ret; return ret; } } Loading