vfs: patch for unpause()/revive() race condition
. unpause() and revive() can race - revive() can run during a device i/o unblock, causing two sendnb()s to occur, and the 2nd one to fail . this can easily happen when a process is blocking on tty and is then killed by a signal - tty cancels the i/o and then kills the process by a signal Change-Id: Ia319acaedfa336b78c030a2c4af7246959bdcf87
This commit is contained in:
parent
a2fcba659c
commit
8f2749cca8
1 changed files with 4 additions and 3 deletions
|
@ -640,13 +640,14 @@ void unpause(endpoint_t proc_e)
|
||||||
panic("VFS: unknown block reason: %d", blocked_on);
|
panic("VFS: unknown block reason: %d", blocked_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
rfp->fp_blocked_on = FP_BLOCKED_ON_NONE;
|
|
||||||
|
|
||||||
if ((blocked_on == FP_BLOCKED_ON_PIPE || blocked_on == FP_BLOCKED_ON_POPEN)&&
|
if ((blocked_on == FP_BLOCKED_ON_PIPE || blocked_on == FP_BLOCKED_ON_POPEN)&&
|
||||||
!wasreviving) {
|
!wasreviving) {
|
||||||
susp_count--;
|
susp_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(rfp->fp_blocked_on != FP_BLOCKED_ON_NONE) {
|
||||||
|
rfp->fp_blocked_on = FP_BLOCKED_ON_NONE;
|
||||||
replycode(proc_e, status); /* signal interrupted call */
|
replycode(proc_e, status); /* signal interrupted call */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue