| #
7f22f3a1 |
| 25-Aug-2026 |
Linus Torvalds <torvalds@linux-foundation.org> |
Merge tag 'ntfs-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs
Pull ntfs updates from Namjae Jeon: "This contains improvements to compression support, metadata handli
Merge tag 'ntfs-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs
Pull ntfs updates from Namjae Jeon: "This contains improvements to compression support, metadata handling, error propagation, and filesystem robustness.
New feature:
- Add optional read support for Windows System Compression (WOF)
Add CONFIG_NTFS_FS_WOF_COMPRESSION and support reading WOF-compressed files through the NTFS page-read path. This includes parsing REPARSE_TAG_WOF, handling resident and non-resident WOF metadata and compressed chunks, and adding kernel-side XPRESS 4K/8K/16K and LZX 32K decompressors. The codecs use a common transparent compression interface shared with LZNT1.
WOF support is read-only and disabled unless explicitly enabled.
Other changes:
- Harden malformed filesystem handling and error paths.
Add bounds and consistency checks for mapping pairs, run lengths, MFT locations, update-sequence offsets, non-resident attributes, compressed attributes, index roots, and bitmap scans. Prevent out-of-bounds accesses in decompression, MFT allocation, and index conversion paths, clean up MFT mappings and attribute search contexts on failure, and propagate attribute and inode initialization errors correctly.
- Improve compressed-file I/O path.
Fix compressed writes on large-page and highmem systems, reuse compression contexts and output workspaces, avoid unnecessary reads for full-unit overwrites, and submit one bio per compressed write unit. Write replacement data before publishing the new mapping, correctly handle zero-filled compressed blocks, and fix initialized-size and folio state updates after compressed writes.
- Synchronize resident reads with MFT record updates.
- Validate the final EA stream size before modifying existing data, rewrite the stream safely when replacing entries, restore the previous state when metadata updates fail, and remove the EA attribute pair when the last entry is deleted.
- Apply Windows filename restrictions only when windows_names is enabled.
- Allow index roots to relocate to extent MFT records when the base record lacks sufficient space.
- Move non-resident attribute payload data before shrinking its record.
- Correct resident-to-non-resident conversion when compression or sparse flags are enabled.
- Prepare file allocation and initialized-size updates before buffered or direct I/O submission, and use pagecache_isize_extended() when extending the file size.
- Fix highmem and page/folio access in compressed I/O paths by using the correct local mappings and page helpers.
- Apply per-file $LXMOD permissions instead of mount masks when available, and prevent unprivileged writes to reserved $LX* attributes
- Update the NTFS maintainer mailing list
- Small cleanups"
* tag 'ntfs-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs: (52 commits) ntfs: support resident WOF decompression ntfs: add non-resident WOF decompression ntfs: implement codec ops for LZX and XPRESS ntfs: port lzx/xpress decompressors from ntfs-3g-system-compression ntfs: return errors from inode initialization ntfs: parse REPARSE_TAG_WOF ntfs: return errors from ntfs_attr_readall ntfs: add WOF compression config option ntfs: define LZNT1 codec ops under transparent codec interface ntfs: introduce transparent compression codec interface ntfs: reject invalid empty mapping pairs ntfs: fix resource leak in ntfs_new_attr_flags ntfs: validate usa_ofs before preserving the update sequence number ntfs: fix off-by-one page overflow in ntfs_decompress() ntfs: do not update ctime when setxattr fails ntfs: reject invalid MFT LCNs from boot sector ntfs: serialize resident iomap reads with mrec_lock ntfs: verify run length exceeding volume boundary ntfs: allow index root relocation ntfs: validate non-resident attribute offsets ...
show more ...
|
| #
f39cd3f7 |
| 21-Aug-2026 |
Hyunchul Lee <hyc.lee@gmail.com> |
ntfs: port lzx/xpress decompressors from ntfs-3g-system-compression
Port the LZX and XPRESS decompressors from the userspace ntfs-3g-system-compression plugin (Eric Biggers, https://github.com/ebigg
ntfs: port lzx/xpress decompressors from ntfs-3g-system-compression
Port the LZX and XPRESS decompressors from the userspace ntfs-3g-system-compression plugin (Eric Biggers, https://github.com/ebiggers/ntfs-3g-system-compression) into the in-tree NTFS driver under lib/, and adapt them to the kernel environment.
The upstream plugin implements WOF ("Windows Overlay Filesystem", a.k.a. system compression / "Compact OS") decompression for the NTFS-3G FUSE driver, and itself borrows the LZX/XPRESS decompressors that the same author wrote for wimlib (https://wimlib.net/). The XPRESS and LZX formats used here are identical to those used in WIM archives. This commit is the kernel-side port that lets fs/ntfs/wof.c read system-compressed files.
The library keeps the upstream subtable-based Huffman decoder (root table + contiguous subtables decoded with MAKE_DECODE_TABLE_ENTRY()), so long codewords only need one extra lookup instead of bit-by-bit tree traversal. The ntfs_codec_ops interface exported to fs/ntfs/wof.c (ntfs_lzx32k_codec_ops and ntfs_xpress{4k,8k,16k}_codec_ops) matches what the WOF layer expects.
Modifications made while porting from the upstream plugin:
- Replace the variable LZX window order (2^15..2^21) with a fixed 32768-byte window, which is the only size WOF uses
- Simplify the bitstream helper: - bitstream_ensure_bits() now guarantees 16 valid bits instead of the carried-over 17-bit refill path from wimlib. Neither LZX (max codeword length 16) nor XPRESS (max 15) needs more than 16 bits.
- Refactor codes to satisfy checkpatch.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
show more ...
|