]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - mm/swapfile.c
mm: kvfree the swap cluster info if the swap file is unsatisfactory
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 8 Sep 2017 23:13:25 +0000 (16:13 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 15 Sep 2017 16:15:08 +0000 (09:15 -0700)
commite3692d25af6933198cd5fc4f94262b6eb9378d83
tree90506cd845c9f410bafc03cdd82c87ca638dd03b
parent9265b0f2ef8ba89b757bf67339ac10010e2f6c14
mm: kvfree the swap cluster info if the swap file is unsatisfactory

BugLink: http://bugs.launchpad.net/bugs/1717549
commit 8606a1a94da5c4e49c0fb28af62d2e75c6747716 upstream.

If initializing a small swap file fails because the swap file has a
problem (holes, etc.) then we need to free the cluster info as part of
cleanup.  Unfortunately a previous patch changed the code to use kvzalloc
but did not change all the vfree calls to use kvfree.

Found by running generic/357 from xfstests.

Link: http://lkml.kernel.org/r/20170831233515.GR3775@magnolia
Fixes: 54f180d3c181 ("mm, swap: use kvzalloc to allocate some swap data structures")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
mm/swapfile.c