diff options
author | Patrick McHardy <kaber@trash.net> | 2007-11-07 05:42:09 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 07:15:12 -0500 |
commit | c3d8d1e30cace31fed6186a4b8c6b1401836d89c (patch) | |
tree | 7122fccf27aa337438123071f3cb07999429de9e /ipc/mqueue.c | |
parent | 230140cffa7feae90ad50bf259db1fa07674f3a7 (diff) |
[NETLINK]: Fix unicast timeouts
Commit ed6dcf4a in the history.git tree broke netlink_unicast timeouts
by moving the schedule_timeout() call to a new function that doesn't
propagate the remaining timeout back to the caller. This means on each
retry we start with the full timeout again.
ipc/mqueue.c seems to actually want to wait indefinitely so this
behaviour is retained.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index bfa274ba9ed4..1e04cd464af9 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -1010,6 +1010,8 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, | |||
1010 | return -EINVAL; | 1010 | return -EINVAL; |
1011 | } | 1011 | } |
1012 | if (notification.sigev_notify == SIGEV_THREAD) { | 1012 | if (notification.sigev_notify == SIGEV_THREAD) { |
1013 | long timeo; | ||
1014 | |||
1013 | /* create the notify skb */ | 1015 | /* create the notify skb */ |
1014 | nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); | 1016 | nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); |
1015 | ret = -ENOMEM; | 1017 | ret = -ENOMEM; |
@@ -1038,8 +1040,8 @@ retry: | |||
1038 | goto out; | 1040 | goto out; |
1039 | } | 1041 | } |
1040 | 1042 | ||
1041 | ret = netlink_attachskb(sock, nc, 0, | 1043 | timeo = MAX_SCHEDULE_TIMEOUT; |
1042 | MAX_SCHEDULE_TIMEOUT, NULL); | 1044 | ret = netlink_attachskb(sock, nc, 0, &timeo, NULL); |
1043 | if (ret == 1) | 1045 | if (ret == 1) |
1044 | goto retry; | 1046 | goto retry; |
1045 | if (ret) { | 1047 | if (ret) { |