diff options
author | David S. Miller <davem@davemloft.net> | 2020-04-25 19:24:42 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-25 20:18:53 -0700 |
commit | d483389678f9e03d53f226641ea39679debcbc81 (patch) | |
tree | e33c9e59627e806ef97be9ef66c48afb1e4ab393 /mm/shmem.c | |
parent | 6033cebdfff9b10192eb254e8cc60fedd595ea7f (diff) | |
parent | b2768df24ec400dd4f7fa79542f797e904812053 (diff) | |
download | linux-d483389678f9e03d53f226641ea39679debcbc81.tar.gz linux-d483389678f9e03d53f226641ea39679debcbc81.tar.bz2 linux-d483389678f9e03d53f226641ea39679debcbc81.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Simple overlapping changes to linux/vermagic.h
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index d722eb830317..bd8840082c94 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -952,7 +952,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, VM_BUG_ON_PAGE(PageWriteback(page), page); if (shmem_punch_compound(page, start, end)) truncate_inode_page(mapping, page); - else { + else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) { /* Wipe the page and don't get stuck */ clear_highpage(page); flush_dcache_page(page); @@ -2179,7 +2179,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; @@ -2194,7 +2198,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) retval = 0; out_nomem: - spin_unlock_irq(&info->lock); return retval; } @@ -2399,11 +2402,11 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, lru_cache_add_anon(page); - spin_lock(&info->lock); + spin_lock_irq(&info->lock); info->alloced++; inode->i_blocks += BLOCKS_PER_PAGE; shmem_recalc_inode(inode); - spin_unlock(&info->lock); + spin_unlock_irq(&info->lock); inc_mm_counter(dst_mm, mm_counter_file(page)); page_add_file_rmap(page, false); |