The patch titled
     signalfd-retrieve-multiple-signals-with-one-read-call tidy
has been removed from the -mm tree.  Its filename was
     signalfd-retrieve-multiple-signals-with-one-read-call-tidy.patch

This patch was dropped because it was folded into 
signalfd-retrieve-multiple-signals-with-one-read-call.patch

------------------------------------------------------
Subject: signalfd-retrieve-multiple-signals-with-one-read-call tidy
From: Davi Arnaut <[EMAIL PROTECTED]>

Simplify signalfd locking following suggestions by Oleg Nesterov.

Signed-off-by: Davi E. M. Arnaut <[EMAIL PROTECTED]>
Cc: Davide Libenzi <[EMAIL PROTECTED]>
Cc: Oleg Nesterov <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/signalfd.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff -puN 
fs/signalfd.c~signalfd-retrieve-multiple-signals-with-one-read-call-tidy 
fs/signalfd.c
--- a/fs/signalfd.c~signalfd-retrieve-multiple-signals-with-one-read-call-tidy
+++ a/fs/signalfd.c
@@ -211,13 +211,11 @@ static int signalfd_copyinfo(struct sign
 static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, siginfo_t *info,
                                int nonblock)
 {
-       int locked;
        ssize_t ret;
        struct signalfd_lockctx lk;
        DECLARE_WAITQUEUE(wait, current);
 
-       locked = signalfd_lock(ctx, &lk);
-       if (!locked)
+       if (!signalfd_lock(ctx, &lk))
                return 0;
 
        ret = dequeue_signal(lk.tsk, &ctx->sigmask, info);
@@ -235,24 +233,24 @@ static ssize_t signalfd_dequeue(struct s
        for (;;) {
                set_current_state(TASK_INTERRUPTIBLE);
                ret = dequeue_signal(lk.tsk, &ctx->sigmask, info);
+               signalfd_unlock(&lk);
                if (ret != 0)
                        break;
                if (signal_pending(current)) {
                        ret = -ERESTARTSYS;
                        break;
                }
-               signalfd_unlock(&lk);
                schedule();
-               locked = signalfd_lock(ctx, &lk);
-               if (unlikely(!locked)) {
+               ret = signalfd_lock(ctx, &lk);
+               if (unlikely(!ret)) {
                        /*
                         * Let the caller read zero byte, ala socket
                         * recv() when the peer disconnect. This test
                         * must be done before doing a dequeue_signal(),
                         * because if the sighand has been orphaned,
-                        * the dequeue_signal() call is going to crash.
+                        * the dequeue_signal() call is going to crash
+                        * because ->sighand will be long gone.
                         */
-                        ret = 0;
                         break;
                }
        }
@@ -260,9 +258,6 @@ static ssize_t signalfd_dequeue(struct s
        remove_wait_queue(&ctx->wqh, &wait);
        __set_current_state(TASK_RUNNING);
 
-       if (likely(locked))
-               signalfd_unlock(&lk);
-
        return ret;
 }
 
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

signalfd-retrieve-multiple-signals-with-one-read-call.patch
signalfd-retrieve-multiple-signals-with-one-read-call-tidy.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to