From: Namjae Jeon <linkinjeon@kernel.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: manualinux@yahoo.es,
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
Matthew Wilcox <willy@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
ntfs3@lists.linux.dev, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] ntfs3: provide block_invalidate_folio to fix memory leak
Date: Mon, 30 May 2022 23:00:20 +0900 [thread overview]
Message-ID: <CAKYAXd-BZK9iG-Od0-60eFOjQ76uSfOJit6k13bR96A_o-wCwA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LRH.2.02.2205300746310.21817@file01.intranet.prod.int.rdu2.redhat.com>
2022-05-30 21:00 GMT+09:00, Mikulas Patocka <mpatocka@redhat.com>:
>
>
> On Mon, 30 May 2022, manualinux@yahoo.es wrote:
>
>>
>> Hello again,
>>
>> When you have time, try moving a large file from a SpadFS partition to
>> an NTFS partition mounted with the NTFS3 driver and with a 5.18 kernel,
>> and then, move the same file back again, to the SpadFS partition. At
>> that very moment is when the size of the file remains permanently in
>> the system memory (in my particular case). This does not happen if we
>> do it to another Linux file system, nor does it happen if we do it from
>> a NTFS partition to another XFS or Ext4 partition.
>>
>> So no ccache or anything, I swap files quite often between the SpadFS
>> partition and an external hard disk with an NTFS partition. Anyway,
>> this problem is really unusual, and it must have some technical
>> explanation, because with the ntfs-3g driver this doesn't happen.
>>
>> If this information is of any use to you I will be satisfied.
>>
>> Regards,
>>
>> José Luis Lara Carrascal - Webmaster de Manualinux - GNU/Linux en
>> Español (https://manualinux.es)
>
> Hi
>
> SpadFS is innocent here :)
>
> The NTFS3 driver in the kernel 5.18 contains the same bug as SpadFS did -
> missing the invalidate_folio method. This patch adds this method and fixes
> the bug.
>
> Mikulas
>
>
>
> Author: Mikulas Patocka <mpatocka@redhat.com>
>
> 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.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: José Luis Lara Carrascal <manualinux@yahoo.es>
> Fixes: 7ba13abbd31e ("fs: Turn block_invalidatepage into
> block_invalidate_folio")
> Cc: stable@vger.kernel.org # v5.18
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
>
> ---
> fs/ntfs3/inode.c | 1 +
> 1 file changed, 1 insertion(+)
>
> Index: linux-2.6/fs/ntfs3/inode.c
> ===================================================================
> --- linux-2.6.orig/fs/ntfs3/inode.c 2022-05-16 16:57:24.000000000 +0200
> +++ linux-2.6/fs/ntfs3/inode.c 2022-05-30 13:36:45.000000000 +0200
linux-2.6 ? Probably you will submit the patch again ?
> @@ -1951,6 +1951,7 @@ const struct address_space_operations nt
> .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 = {
next prev parent reply other threads:[~2022-05-30 15:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220524075112.5438df32.ref@yahoo.es>
[not found] ` <20220524075112.5438df32@yahoo.es>
[not found] ` <alpine.LRH.2.02.2205240501130.17784@file01.intranet.prod.int.rdu2.redhat.com>
[not found] ` <20220524113314.71fe17f0@yahoo.es>
[not found] ` <20220525130538.38fd3d35@yahoo.es>
[not found] ` <20220527072629.332b078d@yahoo.es>
[not found] ` <20220527080211.15d631be@yahoo.es>
[not found] ` <alpine.LRH.2.02.2205271338250.20527@file01.intranet.prod.int.rdu2.redhat.com>
[not found] ` <20220528061836.22230f86@yahoo.es>
[not found] ` <20220530131524.7fb5640d@yahoo.es>
2022-05-30 12:00 ` [PATCH] ntfs3: provide block_invalidate_folio to fix memory leak Mikulas Patocka
2022-05-30 12:18 ` Matthew Wilcox
2022-05-30 12:57 ` Mikulas Patocka
2022-05-30 13:53 ` Matthew Wilcox
2022-05-30 14:00 ` Namjae Jeon [this message]
2022-06-01 10:35 ` Konstantin Komarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKYAXd-BZK9iG-Od0-60eFOjQ76uSfOJit6k13bR96A_o-wCwA@mail.gmail.com \
--to=linkinjeon@kernel.org \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=manualinux@yahoo.es \
--cc=mpatocka@redhat.com \
--cc=ntfs3@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).