diff options
-rw-r--r-- | mm/shmem.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 0a2e1e7801d6..dea5120565d3 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2149,7 +2149,11 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) struct shmem_inode_info *info = SHMEM_I(inode); int retval = -ENOMEM; - spin_lock_irq(&info->lock); + /* + * What serializes the accesses to info->flags? + * ipc_lock_object() when called from shmctl_do_lock(), + * no serialization needed when called from shm_destroy(). + */ if (lock && !(info->flags & VM_LOCKED)) { if (!user_shm_lock(inode->i_size, user)) goto out_nomem; @@ -2164,7 +2168,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) retval = 0; out_nomem: - spin_unlock_irq(&info->lock); return retval; } |