]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/ntfs3: provide block_invalidate_folio to fix memory leak
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 30 May 2022 11:36:45 +0000 (13:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:29:28 +0000 (10:29 +0200)
commit 724bbe49c5e427cb077357d72d240a649f2e4054 upstream.

The ntfs3 filesystem lacks the 'invalidate_folio' method and it causes
memory leak. If you write to the filesystem and then unmount it, the
cached written data are not freed and they are permanently leaked.
Fixes: 7ba13abbd31e ("fs: Turn block_invalidatepage into block_invalidate_folio")
Reported-by: José Luis Lara Carrascal <manualinux@yahoo.es>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: stable@vger.kernel.org # v5.18
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/inode.c

index 9eab11e3b03415528f9b7beedcea58a747c43553..2b0ace850cbada9b1805a64a04903deb7b923a54 100644 (file)
@@ -1951,6 +1951,7 @@ const struct address_space_operations ntfs_aops = {
        .direct_IO      = ntfs_direct_IO,
        .bmap           = ntfs_bmap,
        .dirty_folio    = block_dirty_folio,
+       .invalidate_folio = block_invalidate_folio,
 };
 
 const struct address_space_operations ntfs_aops_cmpr = {