lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] mm: fix lockdep build in rcu-protected get_mm_exe_file()
From
Date
On Mon, 2015-03-23 at 20:10 +0100, Oleg Nesterov wrote:
> "atomic_read(&mm->mm_users) <= 1" looks a bit more "safe". But again,
> I won't insist.

Agreed, it is nicer to do that check, but I have no strong preference
either, perhaps Konstantin or akpm do. Anyway, here's the change that
can be folded in if you guys want to.

Thanks.

8<-------------------------------------------------
diff --git a/kernel/fork.c b/kernel/fork.c
index 98858b5..0c3de2b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -697,7 +697,7 @@ EXPORT_SYMBOL_GPL(mmput);
void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
{
struct file *old_exe_file = rcu_dereference_protected(mm->exe_file,
- !atomic_read(&mm->mm_users) || current->in_execve);
+ atomic_read(&mm->mm_users) <= 1);

if (new_exe_file)
get_file(new_exe_file);



\
 
 \ /
  Last update: 2015-03-24 16:01    [W:0.066 / U:1.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site