]> Pileus Git - ~andy/linux/blobdiff - include/linux/cpuset.h
cpuset: Fix potential deadlock w/ set_mems_allowed
[~andy/linux] / include / linux / cpuset.h
index cc1b01cf2035bced50bfc5d0015d1b6de7a7781b..3fe661fe96d13e534f2b1ece47a409b1609f055c 100644 (file)
@@ -110,10 +110,14 @@ static inline bool put_mems_allowed(unsigned int seq)
 
 static inline void set_mems_allowed(nodemask_t nodemask)
 {
+       unsigned long flags;
+
        task_lock(current);
+       local_irq_save(flags);
        write_seqcount_begin(&current->mems_allowed_seq);
        current->mems_allowed = nodemask;
        write_seqcount_end(&current->mems_allowed_seq);
+       local_irq_restore(flags);
        task_unlock(current);
 }