Commit Graph

1426133 Commits

Author SHA1 Message Date
Hyunchul Lee
14f0a13ec7 ntfs: remove redundant out-of-bound checks
Remove redundant out-of-bounds validations.
Since ntfs_attr_find and ntfs_external_attr_find
now validate the attribute value offsets and
lengths against the bounds of the MFT record block,
performing subsequent bounds checking in caller
functions like ntfs_attr_lookup is no longer necessary.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-04-07 18:36:13 +09:00
Hyunchul Lee
a198a0c4b8 ntfs: add bound checking to ntfs_external_attr_find
Add bound validation in ntfs_external_attr_find to
prevent out-of-bounds memory accesses. This ensures
that the attribute record's length, name offset, and
both resident and non-resident value offsets strictly
fall within the safe boundaries of the MFT record.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-04-07 18:36:09 +09:00
Hyunchul Lee
6ceb4cc81e ntfs: add bound checking to ntfs_attr_find
Add bound validations in ntfs_attr_find to ensure
attribute value offsets and lengths are safe to
access. It verifies that resident attributes meet
type-specific minimum length requirements and
check the mapping_pairs_offset boundaries for
non-resident attributes.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-04-07 18:36:05 +09:00
Hyunchul Lee
77f58db739 ntfs: fix ignoring unreachable code warnings
Detected by Smatch.

inode.c:1796 load_attribute_list_mount() warn:
  ignoring unreachable code.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:52 +09:00
Hyunchul Lee
068a35fd72 ntfs: fix inconsistent indenting warnings
Detected by Smatch.

ndex.c:2041 ntfs_index_walk_up() warn:
  inconsistent indenting

mft.c:2462 ntfs_mft_record_alloc() warn:
  inconsistent indenting

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:49 +09:00
Hyunchul Lee
4e59f8a1a8 ntfs: fix variable dereferenced before check warnings
Detected by Smatch.

lcnalloc.c:736 ntfs_cluster_alloc() error:
  we previously assumed 'rl' could be null (see line 719)

inode.c:3275 ntfs_inode_close() warn:
  variable dereferenced before check 'tmp_nis' (see line 3255)

attrib.c:4952 ntfs_attr_remove() warn:
  variable dereferenced before check 'ni' (see line 4951)

dir.c:1035 ntfs_readdir() error:
  we previously assumed 'private' could be null (see line 850)

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:45 +09:00
Hyunchul Lee
7cf4b3c768 ntfs: prefer IS_ERR_OR_NULL() over manual NULL check
Use IS_ERR_OR_NULL() instead of manual NULL and IS_ERR() checks.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:42 +09:00
Hyunchul Lee
e6a95c5a80 ntfs: harden ntfs_listxattr against EA entries
Validate every EA entry only if the buffer length is required to prevent
large memory allocation.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:40 +09:00
Hyunchul Lee
c451d34ae1 ntfs: harden ntfs_ea_lookup against malformed EA entries
Validate p_ea->ea_name_length tightly, and the used entry size
for every EA.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:38 +09:00
Hyunchul Lee
10993e525b ntfs: check $EA query-length in ntfs_ea_get
if ea_info_qlen exceeds all_ea_size, OOB can happen.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:36 +09:00
Hyunchul Lee
a5325419e9 ntfs: validate WSL EA payload sizes
Enforce the exact-size reads for $LXUID, $LXGID, $LXMOD, $LXDEV.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:34 +09:00
Hyunchul Lee
a732586812 ntfs: fix WSL ea restore condition
Use NTFS_VOL_GID(not NTFS_VOL_UID) for restoring the gid, and call
ntfs_ea_get_wsl_inode() only when $EA_INFORMATION exists.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-16 20:27:30 +09:00
Woody Suwalski
ea3566a3fa ntfs: add missing newlines to pr_err() messages
There is an inconsistent use of pr_err() statements in the current code.
Many error messages are missing the \n termination, what results in the
messages being printed with a delay, only after a next printk() line is
printed. It prevents relying on printk() to monitor the driver errors.
This patch is modifying only text messages, no functional change.

Signed-off-by: Woody Suwalski <terraluna977@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-10 17:52:13 +09:00
Hyunchul Lee
d7bf74c94f ntfs: fix pointer/integer casting warnings
Use uintptr_t for both conversion paths to fix the warnings.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-10 17:46:14 +09:00
Namjae Jeon
e7d8235398 ntfs: use ->mft_no instead of ->i_ino in prints
This improves log accuracy for NTFS debugging and removes unnecessary
reliance on the VFS i_ino field ahead of the core VFS type change.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-06 22:08:42 +09:00
Namjae Jeon
d9038d99fb ntfs: change mft_no type to u64
Changes the type of ntfs_inode::mft_no from unsigned long to u64
to safely handle the full 48-bit range without truncation risk, especially
in preparation for broader VFS inode number type (i_ino:u64) and to
improve consistency with ntfs driver practices.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-06 22:08:39 +09:00
Namjae Jeon
5eed3d6aa5 ntfs: select FS_IOMAP in Kconfig
Add 'select FS_IOMAP' to the NTFS_FS Kconfig option so that CONFIG_NTFS_FS
automatically enables CONFIG_FS_IOMAP when built.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-05 17:37:02 +09:00
Woody Suwalski
040457cfea ntfs: add MODULE_ALIAS_FS
Add missing MODUE_ALIAS record to the ntfs driver to allow automatic
loading of the module.

Signed-off-by: Woody Suwalski <terraluna977@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-05 17:36:13 +09:00
Arnd Bergmann
f462fdf3d6 ntfs: reduce stack usage in ntfs_write_mft_block()
The use of two large arrays in this function makes the stack frame exceed
the warning limit in some configurations, especially with KASAN enabled.
When CONFIG_PAGE_SIZE is set to 65536, each of the arrays contains 128
pointers, so the combined size is 2KB:

fs/ntfs/mft.c: In function 'ntfs_write_mft_block.isra':
fs/ntfs/mft.c:2891:1: error: the frame size of 2640 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]

Use dynamic allocation of these arrays to avoid getting into dangerously
high stack usage.

Unfortunately, allocating memory in the writepages() code path can be
problematic in case of low memory situations, so it would be better to
rework the code more widely to avoid the allocation entirely.

Fixes: 115380f9a2 ("ntfs: update mft operations")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-04 19:37:13 +09:00
Namjae Jeon
a8fde8be9a ntfs: fix sysctl table registration and path
The presence of a sentinel (an empty {}) at the end of the ctl_table array
now causes a "sysctl table check failed" error because the kernel attempts
to validate the null entry as a functional node.
Deleted the empty {} from the ntfs_sysctls array to prevent
the "procname is null" and "No proc_handler" errors and updated the base
path from "fs" to "fs/ntfs" to ensure the ntfs-debug node is correctly
located under /proc/sys/fs/ntfs/.

Reported-by: Woody Suwalski <terraluna977@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-03-01 14:53:37 +09:00
Colin Ian King
e6eb3a0584 ntfs: Fix spelling mistake "initiailized" -> "initialized"
There is a spelling mistake in an ntfs_debug message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-28 12:04:17 +09:00
Ethan Tidmore
ac9ccb6e75 ntfs: Fix possible deadlock
In the error path for ntfs_attr_map_whole_runlist() the lock is not
released.

Add release for lock.

Detected by Smatch:
fs/ntfs/attrib.c:5197 ntfs_non_resident_attr_collapse_range() warn:
inconsistent returns '&ni->runlist.lock'.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-27 18:43:43 +09:00
Ethan Tidmore
1c85157ea8 ntfs: Add missing error code
If ntfs_attr_iget() fails no error code is assigned to be returned.

Detected by Smatch:
fs/ntfs/attrib.c:2665 ntfs_attr_add() warn:
missing error code 'err'

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-27 18:43:40 +09:00
Ethan Tidmore
c418e96754 ntfs: Place check before dereference
The variable ni has the possiblity of being null and is checked for it
but, only after it was dereferenced in a log message.

Put check before dereference.

Detected by Smatch:
fs/ntfs/attrib.c:2115 ntfs_resident_attr_record_add() warn:
variable dereferenced before check 'ni' (see line 2111)

fs/ntfs/attrib.c:2237 ntfs_non_resident_attr_record_add() warn:
variable dereferenced before check 'ni' (see line 2232)

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-27 18:43:38 +09:00
Ethan Tidmore
7c76484fbb ntfs: Remove impossible condition
The variable name_len is checked to see if it's larger than the macro
NTFS_MAX_NAME_LEN however this condition is impossible because name_len
is of type u8 and NTFS_MAX_NAME_LEN is hardcoded to be 255.

Detected by Smatch:
fs/ntfs/namei.c:1175 __ntfs_link() warn:
impossible condition '(name_len > 255) => (0-255 > 255)'

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-26 18:26:12 +09:00
Ethan Tidmore
ec8676c84f ntfs: Replace ERR_PTR(0) with NULL
The variable err is confirmed to be 0 and then never reassigned in the
success path. The function then returns with ERR_PTR(err) which just
equals NULL and can be misleading.

Detected by Smatch:
fs/ntfs/namei.c:1091 ntfs_mkdir() warn:
passing zero to 'ERR_PTR'

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-26 18:26:09 +09:00
Randy Dunlap
9b4253cd63 ntfs: repair docum. malformed table
Make the top and bottom borders be that same length to
avoid a documentation build error:

Documentation/filesystems/ntfs.rst:159: ERROR: Malformed table.
Bottom border or header rule does not match top border.

(top)
======================= ===================================================
(bottom)
======================= ==================================================

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-26 18:26:07 +09:00
Chen Ni
1dbe39666b ntfs: Remove unneeded semicolon
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
semantic patch at scripts/coccinelle/misc/semicolon.cocci.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-26 18:26:04 +09:00
Ethan Tidmore
40c31f0563 ntfs: Fix null pointer dereference
The variable ctx can be null and once confirmed to be null in its error
path goes to label err_out. Once there it can be immediately dereferenced
by the function ntfs_attr_put_search_ctx() which has no null pointer check.

Detected by Smatch:
fs/ntfs/ea.c:687 ntfs_new_attr_flags() error:
we previously assumed 'ctx' could be null (see line 577)

Add null pointer check before running  ntfs_attr_put_search_ctx() in
error path.

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-26 18:26:00 +09:00
Namjae Jeon
2dec6931ee MAINTAINERS: update ntfs filesystem entry
Add myself and Hyunchul Lee as ntfs maintainer.
Since Anton is already listed in CREDITS, only his outdated information
is updated here. the web address in the W: field in his entry is no longer
accessible. Update his CREDITS with the web and email address found in
the ntfs filesystem entry.

Cc: Anton Altaparmakov <anton@tuxera.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:51:05 +09:00
Namjae Jeon
ab00f20ab6 Documentation: filesystems: update NTFS driver documentation
Update the NTFS driver documentation to reflect the update implementation.
Remove outdated sections (web site, old features list, known bugs,
volume/stripe sets with MD/DM driver, limitations of old driver), add a
concise overview of current driver features and long-term maintenance
focus, add a utilities support section pointing to ntfsprogs-plus project
and update mount options list with current supported options.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:51:03 +09:00
Namjae Jeon
47503f9897 ntfs: add Kconfig and Makefile
Introduce Kconfig and Makefile for remade ntfs.
And this patch make ntfs and ntfs3 mutually exclusive so only one can be
built-in(y), while both can still be built as modules(m).

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:51:00 +09:00
Namjae Jeon
f3b47720c2 ntfs3: remove legacy ntfs driver support
Reverts the following commits that introduced legacy ntfs
driver alias and related support code:

74871791ff ntfs3: serve as alias for the legacy ntfs driver
1ff2e95660 fs/ntfs3: Redesign legacy ntfs support
9b872cc50d ntfs3: add legacy ntfs file operations
d55f90e9b2 ntfs3: enforce read-only when used as legacy ntfs driver

The legacy ntfs driver has been remade as a new implementation, so the
alias and related codes in ntfs3 are no longer needed.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:58 +09:00
Namjae Jeon
5218cd102a ntfs: update misc operations
Updates various miscellaneous operations including collation,
debugging, logfile handling, unicode string processing, bdev io helpers,
object id system file handling.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:56 +09:00
Namjae Jeon
fc053f05ca ntfs: add reparse and ea operations
Implement support for Extended Attributes and Reparse Points, enabling
Posix ACL support and, and compatibility with Windows Subsystem for
Linux (WSL) metadata.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:54 +09:00
Namjae Jeon
11ccc9107d ntfs: update runlist handling and cluster allocator
Updates runlist handling and cluster allocation to support
contiguous allocations and filesystem trimming.

Improve the runlist API to handle allocation failures and introduces
discard support.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:52 +09:00
Namjae Jeon
495e90fa33 ntfs: update attrib operations
Overhaul the attribute operations to support write access, including
full attribute list management for handling multiple MFT records, and
compressed writes.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:50 +09:00
Namjae Jeon
b041ca5625 ntfs: update iomap and address space operations
Update the address space operations to use the iomap framework,
replacing legacy buffer-head based code.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:48 +09:00
Namjae Jeon
9c87959601 ntfs: update file operations
Rewrite the file operations to utilize the iomap infrastructure,
replacing the legacy buffer-head based implementation.

Implement ntfs_setattr() with size change handling, uid/gid/mode.

Add support for Direct I/O.

Add support for fallocate with the FALLOC_FL_KEEP_SIZE,
FALLOC_FL_PUNCH_HOLE, FALLOC_FL_COLLAPSE_RANGE, FALLOC_FL_INSERT_RANGE
and FALLOC_FL_ALLOCATE_RANGE modes.

Implement .llseek with SEEK_DATA / SEEK_HOLE support.

Implement ntfs_fiemap() using iomap_fiemap().

Add FS_IOC_SHUTDOWN, FS_IOC_[GS]ETFSLABEL, FITRIM ioctl support.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:50:42 +09:00
Namjae Jeon
0a8ac0c1fa ntfs: update directory operations
Update the directory and index operations to support full read-write
functionality and use the folio API, including directory modification.

Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:07 +09:00
Namjae Jeon
115380f9a2 ntfs: update mft operations
Refactors MFT record handling to use folio APIs with consistency
validation, and improving allocation extension and writeback paths
for  and .

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:07 +09:00
Namjae Jeon
af0db57d42 ntfs: update inode operations
Add extent inode loading via ntfs_extent_inode_open() and
ntfs_inode_attach_all_extents().

Allow dynamic creation of  with ntfs_inode_add_attrlist() when
the base MFT record overflows.

Introduce ntfs_inode_free_space() to move attributes out of
the base record on demand.

Implement direct attribute I/O through ntfs_inode_attr_pread() and
ntfs_inode_attr_pwrite().

Implement .create, .unlink, .mkdir, .rmdir, .rename, .symlink, .mknod,
.link callbacks.

Introduce ntfs_non_resident_dealloc_clusters() to free clusters of
non-resident attributes during inode eviction.

Add ntfs_drop_big_inode() logic to safely truncate and deallocate
clusters.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:06 +09:00
Namjae Jeon
6251f0b0de ntfs: update super block operations
Update the super block operations to support the new fs_context-based
mount API, full read-write support including ->sync_fs, and file system
shutdown support.

Update ntfs_statfs() to provide statistics using atomic counters for free
clusters and MFT records.

Add a dedicated workqueue to compute the total number of free clusters by
scanning  asynchronously. Synchronous bitmap scanning during mount
can take a very long time on large volumes, severely delaying mount
completion. Moving this to the background allows mount to finish almost
immediately.

Implement ntfs_write_volume_label() to allow changing the volume label.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:06 +09:00
Namjae Jeon
4079605199 ntfs: update in-memory, on-disk structures and headers
Update the NTFS filesystem driver's in-memory and on-disk structures:

  - Introduce the  infrastructure and initial support for reparse
    points and EA attribute.
  - Refactor the core ntfs_inode and ntfs_volume structures to support
    new features such as iomap.
  - Remove the unnecessary types.h and endian.h headers.
  - Reorganize the comments in headers for better readability, including
    fixing warnings from checkpatch.pl.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:06 +09:00
Namjae Jeon
1f662195db fs: add generic FS_IOC_SHUTDOWN definitions
Currently, several filesystems (e.g., xfs, ext4, btrfs) implement
a "shutdown" or "going down" ioctl to simulate filesystem force a shutdown.
While they often use the same underlying numeric value, the definition is
duplicated across filesystem headers or private definitions.

Add generic definitions for FS_IOC_SHUTDOWN in uapi/linux/fs.h.
This allows new filesystems (like ntfs) to implement this feature using
a standard VFS definition and paves the way for existing filesystems
to unify their definitions later.

The flag names are standardized as FS_SHUTDOWN_* to be consistent with
the ioctl name, replacing the historical GOING_DOWN naming convention.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:05 +09:00
Namjae Jeon
1e9ea7e044 Revert "fs: Remove NTFS classic"
This reverts commit 7ffa8f3d30.

Reverts the removal of the classic read-only ntfs driver to
serve as the base for a new read-write ntfs implementation.
If we stack changes on top of the revert patch, It will significantly
reduce the diff size, making the review easier.

This revert intentionally excludes the restoration of Kconfig and
Makefile. The Kconfig and Makefile will be added back in the final patch
of this series, enabling the driver only after all features and
improvements have been applied.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-02-19 21:48:05 +09:00
Linus Torvalds
2b7a25df82 Merge tag 'mm-nonmm-stable-2026-02-18-19-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull more non-MM updates from Andrew Morton:

 - "two fixes in kho_populate()" fixes a couple of not-major issues in
   the kexec handover code (Ran Xiaokai)

 - misc singletons

* tag 'mm-nonmm-stable-2026-02-18-19-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  lib/group_cpus: handle const qualifier from clusters allocation type
  kho: remove unnecessary WARN_ON(err) in kho_populate()
  kho: fix missing early_memunmap() call in kho_populate()
  scripts/gdb: implement x86_page_ops in mm.py
  objpool: fix the overestimation of object pooling metadata size
  selftests/memfd: use IPC semaphore instead of SIGSTOP/SIGCONT
  delayacct: fix build regression on accounting tool
2026-02-18 21:40:16 -08:00
Linus Torvalds
eeccf287a2 Merge tag 'mm-stable-2026-02-18-19-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull more MM  updates from Andrew Morton:

 - "mm/vmscan: fix demotion targets checks in reclaim/demotion" fixes a
   couple of issues in the demotion code - pages were failed demotion
   and were finding themselves demoted into disallowed nodes (Bing Jiao)

 - "Remove XA_ZERO from error recovery of dup_mmap()" fixes a rare
   mapledtree race and performs a number of cleanups (Liam Howlett)

 - "mm: add bitmap VMA flag helpers and convert all mmap_prepare to use
   them" implements a lot of cleanups following on from the conversion
   of the VMA flags into a bitmap (Lorenzo Stoakes)

 - "support batch checking of references and unmapping for large folios"
   implements batching to greatly improve the performance of reclaiming
   clean file-backed large folios (Baolin Wang)

 - "selftests/mm: add memory failure selftests" does as claimed (Miaohe
   Lin)

* tag 'mm-stable-2026-02-18-19-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (36 commits)
  mm/page_alloc: clear page->private in free_pages_prepare()
  selftests/mm: add memory failure dirty pagecache test
  selftests/mm: add memory failure clean pagecache test
  selftests/mm: add memory failure anonymous page test
  mm: rmap: support batched unmapping for file large folios
  arm64: mm: implement the architecture-specific clear_flush_young_ptes()
  arm64: mm: support batch clearing of the young flag for large folios
  arm64: mm: factor out the address and ptep alignment into a new helper
  mm: rmap: support batched checks of the references for large folios
  tools/testing/vma: add VMA userland tests for VMA flag functions
  tools/testing/vma: separate out vma_internal.h into logical headers
  tools/testing/vma: separate VMA userland tests into separate files
  mm: make vm_area_desc utilise vma_flags_t only
  mm: update all remaining mmap_prepare users to use vma_flags_t
  mm: update shmem_[kernel]_file_*() functions to use vma_flags_t
  mm: update secretmem to use VMA flags on mmap_prepare
  mm: update hugetlbfs to use VMA flags on mmap_prepare
  mm: add basic VMA flag operation helper functions
  tools: bitmap: add missing bitmap_[subset(), andnot()]
  mm: add mk_vma_flags() bitmap flag macro helper
  ...
2026-02-18 20:50:32 -08:00
Linus Torvalds
956b9cbd7f Merge tag 'kbuild-fixes-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux
Pull Kbuild fixes from Nathan Chancellor:

 - Ensure tools/objtool is cleaned by 'make clean' and 'make mrproper'

 - Fix test program for CONFIG_CC_CAN_LINK to avoid a warning, which is
   made fatal by -Werror

 - Drop explicit LZMA parallel compression in scripts/make_fit.py

 - Several fixes for commit 62089b8048 ("kbuild: rpm-pkg: Generate
   debuginfo package manually")

* tag 'kbuild-fixes-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
  kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package
  kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm
  kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package
  kbuild: rpm-pkg: Restrict manual debug package creation
  scripts/make_fit.py: Drop explicit LZMA parallel compression
  kbuild: Fix CC_CAN_LINK detection
  kbuild: Add objtool to top-level clean target
2026-02-18 14:59:55 -08:00
Linus Torvalds
fa2827e72c Merge tag 'thermal-7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fix from Rafael Wysocki:
 "This fixes a sysfs group leak on DLVR registration failure in the
  Intel int340x thermal driver (Kaushlendra Kumar)"

* tag 'thermal-7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: int340x: Fix sysfs group leak on DLVR registration failure
2026-02-18 14:33:18 -08:00