]> git.baikalelectronics.ru Git - kernel.git/commit
shmem: fix double uncharge in __shmem_file_setup()
authorKonstantin Khlebnikov <koct9i@gmail.com>
Wed, 6 Aug 2014 23:06:32 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:18 +0000 (18:01 -0700)
commitaf14884e88534d16c0dca1a35536fd6a37db4602
treeca202430d326aaca6ad5f11e7296ccf1956aa961
parent30390e6289060398bf18c516eab359d86af32bc1
shmem: fix double uncharge in __shmem_file_setup()

If __shmem_file_setup() fails on struct file allocation it uncharges
memory commitment twice: first by shmem_unacct_size() and second time
implicitly in shmem_evict_inode() when it kills the newly created inode.

This patch removes shmem_unacct_size() from error path if the inode was
already there.

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c