linux/fs/ntfs3
Ism Hong d6d33f03ba
fs/ntfs3: use non-movable memory for ntfs3 MFT buffer cache
Since the buffer cache for ntfs3 metadata is not released until the file
system is unmounted, allocating from the movable zone may result in cma
allocation failures. This is due to the page still being used by ntfs3,
leading to migration failures.

To address this, this commit use sb_bread_umovable() instead of
sb_bread(). This change prevents allocation from the movable zone,
ensuring compatibility with scenarios where the buffer head is not
released until unmount. This patch is inspired by commit
a8ac900b8163("ext4: use non-movable memory for the ext4 superblock").

The issue is found when playing video files stored in NTFS on the
Android TV platform. During this process, the media parser reads the
video file, causing ntfs3 to allocate buffer cache from the CMA area.
Subsequently, the hardware decoder attempts to allocate memory from the
same CMA area. However, the page is still in use by ntfs3, resulting in
a migrate failure in alloc_contig_range().

The pinned page and allocating stacktrace reported by page owner shows
below:

page:ffffffff00b68880 refcount:3 mapcount:0 mapping:ffffff80046aa828
        index:0xc0040 pfn:0x20fa4
    aops:def_blk_aops ino:0
    flags: 0x2020(active|private)
    page dumped because: migration failure
    page last allocated via order 0, migratetype Movable,
        gfp_mask 0x108c48
        (GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE),
    page_owner tracks the page as allocated
     prep_new_page
     get_page_from_freelist
     __alloc_pages_nodemask
     pagecache_get_page
     __getblk_gfp
     __bread_gfp
     ntfs_read_run_nb
     ntfs_read_bh
     mi_read
     ntfs_iget5
     dir_search_u
     ntfs_lookup
     __lookup_slow
     lookup_slow
     walk_component
     path_lookupat

Signed-off-by: Ism Hong <ism.hong@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
2024-01-29 10:48:33 +03:00
..
lib fs/ntfs3: Add missing header and guards to lib/ headers 2021-09-13 19:41:44 +03:00
attrib.c fs/ntfs3: Add NULL ptr dereference checking at the end of attr_allocate_frame() 2023-12-06 17:46:16 +03:00
attrlist.c fs/ntfs3: Use kvfree to free memory allocated by kvmalloc 2024-01-16 11:31:56 +03:00
bitfunc.c fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring 2022-11-14 19:50:42 +03:00
bitmap.c fs/ntfs3: Use kvfree to free memory allocated by kvmalloc 2024-01-16 11:31:56 +03:00
debug.h fs/ntfs3. Add forward declarations for structs to debug.h 2021-09-13 19:41:43 +03:00
dir.c fs/ntfs3: Add and fix comments 2023-12-06 17:46:15 +03:00
file.c fs/ntfs3: Implement super_operations::shutdown 2023-12-06 17:46:14 +03:00
frecord.c fs/ntfs3: Use kvfree to free memory allocated by kvmalloc 2024-01-16 11:31:56 +03:00
fslog.c fs/ntfs3: Reduce stack usage 2023-12-06 17:46:09 +03:00
fsntfs.c fs/ntfs3: Add and fix comments 2023-12-06 17:46:15 +03:00
index.c fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() 2023-09-28 15:04:05 +03:00
inode.c fs/ntfs3: Implement super_operations::shutdown 2023-12-06 17:46:14 +03:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
lznt.c fs/ntfs3: Code formatting 2023-07-03 00:21:27 +04:00
Makefile
namei.c fs/ntfs3: Implement super_operations::shutdown 2023-12-06 17:46:14 +03:00
ntfs_fs.h fs/ntfs3: use non-movable memory for ntfs3 MFT buffer cache 2024-01-29 10:48:33 +03:00
ntfs.h fs/ntfs3: Disable ATTR_LIST_ENTRY size check 2023-12-21 14:25:40 +03:00
record.c fs/ntfs3: Correct hard links updating when dealing with DOS names 2023-12-06 17:46:08 +03:00
run.c fs/ntfs3: Code formatting 2023-07-03 00:21:27 +04:00
super.c fs/ntfs3: Use kvfree to free memory allocated by kvmalloc 2024-01-16 11:31:56 +03:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: Implement super_operations::shutdown 2023-12-06 17:46:14 +03:00