Files
ncpfs/patches/lockup-2.0.28.diff
ncpfs archive import c6c6fbe4ca Import ncpfs 2.1.1
2026-04-28 20:39:59 +02:00

45 lines
1.2 KiB
Diff

diff -urN 2.0.11/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
--- 2.0.28/fs/ncpfs/sock.c Fri Jul 12 08:14:53 1996
+++ linux/fs/ncpfs/sock.c Thu Aug 8 19:27:26 1996
@@ -55,7 +55,8 @@
{
struct iovec iov;
struct msghdr msg;
-
+ int result;
+
iov.iov_base = (void *)buff;
iov.iov_len = len;
@@ -65,7 +66,29 @@
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
- return sock->ops->sendmsg(sock, &msg, len, nonblock, flags);
+ result = sock->ops->sendmsg(sock, &msg, len, 1, flags);
+
+ if ((result != -EAGAIN) || (nonblock != 0))
+ {
+ return result;
+ }
+
+ /* The following is probably one of the worst sins you can do
+ to a multitasking kernel: active polling. But when you call
+ ipx_sendmsg with nonblock==0, then it will block forever
+ from time to time. I really do not know why. To work around
+ this, I try to send the packet with nonblock=1 and retry
+ it. */
+
+ do {
+ /* Before retrying, give others a chance */
+ current->state = TASK_INTERRUPTIBLE;
+ current->timeout = jiffies + HZ/10;
+ schedule();
+ result = sock->ops->sendmsg(sock, &msg, len, 1, flags);
+ } while (result == -EAGAIN);
+
+ return result;
}