diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-07-18 11:17:17 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-07-18 11:17:17 +0200 |
commit | a2fe194723f6e4990d01d8c208c7b138fd410522 (patch) | |
tree | 7aee93fa8f4ba1e18b56fa7d8eab75d249fc6966 /fs/fifo.c | |
parent | c3b7cdf180090d2686239a75bb0ae408108ed749 (diff) | |
parent | a018540141a931f5299a866907b27886916b4374 (diff) |
Merge branch 'linus' into perf/core
Pick up the latest ring-buffer fixes, before applying a new fix.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/fifo.c')
-rw-r--r-- | fs/fifo.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/fifo.c b/fs/fifo.c index b1a524d798e7..cf6f4345ceb0 100644 --- a/fs/fifo.c +++ b/fs/fifo.c @@ -14,7 +14,7 @@ #include <linux/sched.h> #include <linux/pipe_fs_i.h> -static void wait_for_partner(struct inode* inode, unsigned int *cnt) +static int wait_for_partner(struct inode* inode, unsigned int *cnt) { int cur = *cnt; @@ -23,6 +23,7 @@ static void wait_for_partner(struct inode* inode, unsigned int *cnt) if (signal_pending(current)) break; } + return cur == *cnt ? -ERESTARTSYS : 0; } static void wake_up_partner(struct inode* inode) @@ -67,8 +68,7 @@ static int fifo_open(struct inode *inode, struct file *filp) * seen a writer */ filp->f_version = pipe->w_counter; } else { - wait_for_partner(inode, &pipe->w_counter); - if(signal_pending(current)) + if (wait_for_partner(inode, &pipe->w_counter)) goto err_rd; } } @@ -90,8 +90,7 @@ static int fifo_open(struct inode *inode, struct file *filp) wake_up_partner(inode); if (!pipe->readers) { - wait_for_partner(inode, &pipe->r_counter); - if (signal_pending(current)) + if (wait_for_partner(inode, &pipe->r_counter)) goto err_wr; } break; |