diff options
| -rw-r--r-- | fs/splice.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/splice.c b/fs/splice.c index 26f5f7ecee5c..9f796b1034d1 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
| @@ -187,7 +187,9 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages, | |||
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | if (do_wakeup) { | 189 | if (do_wakeup) { |
| 190 | wake_up_interruptible_sync(PIPE_WAIT(*inode)); | 190 | smp_mb(); |
| 191 | if (waitqueue_active(PIPE_WAIT(*inode))) | ||
| 192 | wake_up_interruptible_sync(PIPE_WAIT(*inode)); | ||
| 191 | kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, | 193 | kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, |
| 192 | POLL_IN); | 194 | POLL_IN); |
| 193 | do_wakeup = 0; | 195 | do_wakeup = 0; |
| @@ -201,7 +203,9 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages, | |||
| 201 | mutex_unlock(PIPE_MUTEX(*inode)); | 203 | mutex_unlock(PIPE_MUTEX(*inode)); |
| 202 | 204 | ||
| 203 | if (do_wakeup) { | 205 | if (do_wakeup) { |
| 204 | wake_up_interruptible(PIPE_WAIT(*inode)); | 206 | smp_mb(); |
| 207 | if (waitqueue_active(PIPE_WAIT(*inode))) | ||
| 208 | wake_up_interruptible(PIPE_WAIT(*inode)); | ||
| 205 | kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, POLL_IN); | 209 | kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, POLL_IN); |
| 206 | } | 210 | } |
| 207 | 211 | ||
| @@ -600,7 +604,9 @@ static ssize_t move_from_pipe(struct inode *inode, struct file *out, | |||
| 600 | } | 604 | } |
| 601 | 605 | ||
| 602 | if (do_wakeup) { | 606 | if (do_wakeup) { |
| 603 | wake_up_interruptible_sync(PIPE_WAIT(*inode)); | 607 | smp_mb(); |
| 608 | if (waitqueue_active(PIPE_WAIT(*inode))) | ||
| 609 | wake_up_interruptible_sync(PIPE_WAIT(*inode)); | ||
| 604 | kill_fasync(PIPE_FASYNC_WRITERS(*inode),SIGIO,POLL_OUT); | 610 | kill_fasync(PIPE_FASYNC_WRITERS(*inode),SIGIO,POLL_OUT); |
| 605 | do_wakeup = 0; | 611 | do_wakeup = 0; |
| 606 | } | 612 | } |
| @@ -611,7 +617,9 @@ static ssize_t move_from_pipe(struct inode *inode, struct file *out, | |||
| 611 | mutex_unlock(PIPE_MUTEX(*inode)); | 617 | mutex_unlock(PIPE_MUTEX(*inode)); |
| 612 | 618 | ||
| 613 | if (do_wakeup) { | 619 | if (do_wakeup) { |
| 614 | wake_up_interruptible(PIPE_WAIT(*inode)); | 620 | smp_mb(); |
| 621 | if (waitqueue_active(PIPE_WAIT(*inode))) | ||
| 622 | wake_up_interruptible(PIPE_WAIT(*inode)); | ||
| 615 | kill_fasync(PIPE_FASYNC_WRITERS(*inode), SIGIO, POLL_OUT); | 623 | kill_fasync(PIPE_FASYNC_WRITERS(*inode), SIGIO, POLL_OUT); |
| 616 | } | 624 | } |
| 617 | 625 | ||
