]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
shmem: shmem_charge: verify max_block is not exceeded before inode update
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Wed, 6 Sep 2017 23:22:56 +0000 (16:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 00:27:28 +0000 (17:27 -0700)
commitb1cc94ab2f2ba31fcb2c59df0b9cf03f6d720553
tree3894b1c311654938ea6525af4eb975c695e1966b
parentfe490cc0fe9e6ee48cc48bb5dc463bc5f0f1428f
shmem: shmem_charge: verify max_block is not exceeded before inode update

Patch series "userfaultfd: enable zeropage support for shmem".

These patches enable support for UFFDIO_ZEROPAGE for shared memory.

The first two patches are not strictly related to userfaultfd, they are
just minor refactoring to reduce amount of code duplication.

This patch (of 7):

Currently we update inode and shmem_inode_info before verifying that
used_blocks will not exceed max_blocks.  In case it will, we undo the
update.  Let's switch the order and move the verification of the blocks
count before the inode and shmem_inode_info update.

Link: http://lkml.kernel.org/r/1497939652-16528-2-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c