Page MenuHomeFreeBSD

D10414.id27496.diff
No OneTemporary

D10414.id27496.diff

Index: sys/compat/linuxkpi/common/src/linux_compat.c
===================================================================
--- sys/compat/linuxkpi/common/src/linux_compat.c
+++ sys/compat/linuxkpi/common/src/linux_compat.c
@@ -1351,18 +1351,22 @@
long
linux_wait_for_timeout_common(struct completion *c, long timeout, int flags)
{
- long end = jiffies + timeout;
+ long end = jiffies + timeout, error;
+ int ret;
if (SCHEDULER_STOPPED())
return (0);
+ DROP_GIANT();
+
if (flags != 0)
flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP;
else
flags = SLEEPQ_SLEEP;
- for (;;) {
- int ret;
+ error = 0;
+ ret = 0;
+ for (;;) {
sleepq_lock(c);
if (c->done)
break;
@@ -1375,16 +1379,20 @@
if (ret != 0) {
/* check for timeout or signal */
if (ret == EWOULDBLOCK)
- return (0);
+ error = 0;
else
- return (-ERESTARTSYS);
+ error = -ERESTARTSYS;
+ goto intr;
}
}
c->done--;
sleepq_release(c);
+intr:
+ PICKUP_GIANT();
+
/* return how many jiffies are left */
- return (linux_timer_jiffies_until(end));
+ return (ret != 0 ? error : linux_timer_jiffies_until(end));
}
int

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 20, 1:25 PM (4 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41079012
Default Alt Text
D10414.id27496.diff (1 KB)

Event Timeline