OSDN Git Service

Revert "Revert "Revert "CHROMIUM: android: binder: Fix potential scheduling-while...
authorTodd Kjos <tkjos@google.com>
Tue, 11 Apr 2017 21:39:47 +0000 (21:39 +0000)
committerTodd Kjos <tkjos@google.com>
Tue, 11 Apr 2017 21:40:04 +0000 (21:40 +0000)
This reverts commit 6a3b9c4984f9edc5a136720e42f1d2ab387857a4.

Sigh. Confusion reigns. The rest of the preempt_disable patch is not in common, so this shouldn't be here afterall (it is in several downstream branches that therefore need this one too).

Re-reverting. We don't want the preempt_disable stuff in common since fine-grained locking is coming soon.

Change-Id: I2595516cab28041fa72f4a38692266a0f2a01ab4

drivers/android/binder.c

index 22025bc..9cf4f9b 100644 (file)
@@ -417,7 +417,6 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
        struct files_struct *files = proc->files;
        unsigned long rlim_cur;
        unsigned long irqs;
-       int ret;
 
        if (files == NULL)
                return -ESRCH;
@@ -428,11 +427,7 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
        rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE);
        unlock_task_sighand(proc->tsk, &irqs);
 
-       preempt_enable_no_resched();
-       ret = __alloc_fd(files, 0, rlim_cur, flags);
-       preempt_disable();
-
-       return ret;
+       return __alloc_fd(files, 0, rlim_cur, flags);
 }
 
 /*
@@ -441,11 +436,8 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
 static void task_fd_install(
        struct binder_proc *proc, unsigned int fd, struct file *file)
 {
-       if (proc->files) {
-               preempt_enable_no_resched();
+       if (proc->files)
                __fd_install(proc->files, fd, file);
-               preempt_disable();
-       }
 }
 
 /*