fs/ntfs3: Update inode->i_mapping->a_ops on compression state
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 30 Jan 2025 14:03:41 +0000 (17:03 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 5 Feb 2025 14:48:41 +0000 (17:48 +0300)
commitb432163ebd15a0fb74051949cb61456d6c55ccbd
tree524a562a9dd57a9233c47817d811e479a400ca6a
parentff355926445897cc9fdea3b00611e514232c213c
fs/ntfs3: Update inode->i_mapping->a_ops on compression state

Update inode->i_mapping->a_ops when the compression state changes to
ensure correct address space operations.
Clear ATTR_FLAG_SPARSED/FILE_ATTRIBUTE_SPARSE_FILE when enabling
compression to prevent flag conflicts.

v2:
Additionally, ensure that all dirty pages are flushed and concurrent access
to the page cache is blocked.

Fixes: 6b39bfaeec44 ("fs/ntfs3: Add support for the compression attribute")
Reported-by: Kun Hu <huk23@m.fudan.edu.cn>, Jiaji Qin <jjtan24@m.fudan.edu.cn>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/attrib.c
fs/ntfs3/file.c
fs/ntfs3/frecord.c