mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
mm: rcu-protected get_mm_exe_file()
This patch removes mm->mmap_sem from mm->exe_file read side. Also it kills dup_mm_exe_file() and moves exe_file duplication into dup_mmap() where both mmap_sems are locked. [[email protected]: fix comment typo] Signed-off-by: Konstantin Khlebnikov <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Al Viro <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0ec62afeb1
commit
90f31d0ea8
4 changed files with 40 additions and 22 deletions
|
|
@ -638,8 +638,7 @@ static struct file *__fget(unsigned int fd, fmode_t mask)
|
|||
file = fcheck_files(files, fd);
|
||||
if (file) {
|
||||
/* File object ref couldn't be taken */
|
||||
if ((file->f_mode & mask) ||
|
||||
!atomic_long_inc_not_zero(&file->f_count))
|
||||
if ((file->f_mode & mask) || !get_file_rcu(file))
|
||||
file = NULL;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
|
|
|||
Loading…
Reference in a new issue