X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fshmem.c;h=45b9acb575f9c5c2ad6a869d1e7c28abba3a890e;hb=70c9f18ca8f3652c7dcf715e9f0d41c399fe130d;hp=2d357729529880b29f18704edda807108f6cdc5b;hpb=571109f5369efbd3f7d09b4e331c1aa4de3e411a;p=cascardo%2Flinux.git diff --git a/mm/shmem.c b/mm/shmem.c index 2d3577295298..45b9acb575f9 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1068,6 +1068,12 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) user_shm_unlock(inode->i_size, user); info->flags &= ~VM_LOCKED; mapping_clear_unevictable(file->f_mapping); + /* + * Ensure that a racing putback_lru_page() can see + * the pages of this mapping are evictable when we + * skip them due to !PageLRU during the scan. + */ + smp_mb__after_clear_bit(); scan_mapping_unevictable_pages(file->f_mapping); } retval = 0; @@ -2497,7 +2503,7 @@ struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags d_instantiate(path.dentry, inode); inode->i_size = size; - inode->i_nlink = 0; /* It is unlinked */ + clear_nlink(inode); /* It is unlinked */ #ifndef CONFIG_MMU error = ramfs_nommu_expand_for_mapping(inode, size); if (error)