Commit cdd4dc3a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ntfs resurrection from Namjae Jeon:
 "Ever since Kari Argillander’s 2022 report [1] regarding the state of
  the ntfs3 driver, I have spent the last 4 years working to provide
  full write support and current trends (iomap, no buffer head, folio),
  enhanced performance, stable maintenance, utility support including
  fsck for NTFS in Linux.

  This new implementation is built upon the clean foundation of the
  original read-only NTFS driver, adding:

   - Write support:

     Implemented full write support based on the classic read-only NTFS
     driver. Added delayed allocation to improve write performance
     through multi-cluster allocation and reduced fragmentation of the
     cluster bitmap.

   - iomap conversion:

     Switched buffered IO (reads/writes), direct IO, file extent
     mapping, readpages, and writepages to use iomap.

   - Remove buffer_head:

     Completely removed buffer_head usage by converting to folios. As a
     result, the dependency on CONFIG_BUFFER_HEAD has been removed from
     Kconfig.

   - Stability improvements:

     The new ntfs driver passes 326 xfstests, compared to 273 for ntfs3.
     All tests passed by ntfs3 are a complete subset of the tests passed
     by this implementation. Added support for fallocate, idmapped
     mounts, permissions, and more.

  xfstests Results report:

     Total tests run: 787
     Passed         : 326
     Failed         : 38
     Skipped        : 423

  Failed tests breakdown:
    - 34 tests require metadata journaling
    - 4 other tests:
         094: No unwritten extent concept in NTFS on-disk format
         563: cgroup v2 aware writeback accounting not supported
         631: RENAME_WHITEOUT support required
         787: NFS delegation test"

Link: https://lore.kernel.org/all/da20d32b-5185-f40b-48b8-2986922d8b25@stargateuniverse.net/ [1]

[ Let's see if this undead filesystem ends up being of the "Easter
  miracle" kind, or the "Nosferatu of filesystems" kind... ]

* tag 'ntfs-for-7.1-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs: (46 commits)
  ntfs: remove redundant out-of-bound checks
  ntfs: add bound checking to ntfs_external_attr_find
  ntfs: add bound checking to ntfs_attr_find
  ntfs: fix ignoring unreachable code warnings
  ntfs: fix inconsistent indenting warnings
  ntfs: fix variable dereferenced before check warnings
  ntfs: prefer IS_ERR_OR_NULL() over manual NULL check
  ntfs: harden ntfs_listxattr against EA entries
  ntfs: harden ntfs_ea_lookup against malformed EA entries
  ntfs: check $EA query-length in ntfs_ea_get
  ntfs: validate WSL EA payload sizes
  ntfs: fix WSL ea restore condition
  ntfs: add missing newlines to pr_err() messages
  ntfs: fix pointer/integer casting warnings
  ntfs: use ->mft_no instead of ->i_ino in prints
  ntfs: change mft_no type to u64
  ntfs: select FS_IOMAP in Kconfig
  ntfs: add MODULE_ALIAS_FS
  ntfs: reduce stack usage in ntfs_write_mft_block()
  ntfs: fix sysctl table registration and path
  ...
parents eb0d6d97 14f0a13e
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -71,11 +71,6 @@ D: dosfs, LILO, some fd features, ATM, various other hacks here and there
S: Buenos Aires
S: Argentina

NTFS FILESYSTEM
N: Anton Altaparmakov
E: anton@tuxera.com
D: NTFS filesystem

N: Tim Alpaerts
E: tim_alpaerts@toyota-motor-europe.com
D: 802.2 class II logical link control layer,
@@ -85,8 +80,8 @@ S: B-2610 Wilrijk-Antwerpen
S: Belgium

N: Anton Altaparmakov
E: aia21@cantab.net
W: http://www-stu.christs.cam.ac.uk/~aia21/
E: anton@tuxera.com
W: http://www.tuxera.com/
D: Author of new NTFS driver, various other kernel hacks.
S: Christ's College
S: Cambridge CB2 3BU
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ Documentation for filesystem implementations.
   isofs
   nilfs2
   nfs/index
   ntfs
   ntfs3
   ocfs2
   ocfs2-online-filecheck
+159 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

=================================
The Linux NTFS filesystem driver
=================================


.. Table of contents

   - Overview
   - Utilities support
   - Supported mount options


Overview
========

NTFS is a Linux kernel filesystem driver that provides full read and write
support for NTFS volumes. It is designed for high performance, modern
kernel infrastructure (iomap, folio), and stable long-term maintenance.


Utilities support
=================

The NTFS utilities project, called ntfsprogs-plus, provides mkfs.ntfs,
fsck.ntfs, and other related tools (e.g., ntfsinfo, ntfsclone, etc.) for
creating, checking, and managing NTFS volumes. These utilities can be used
for filesystem testing with xfstests as well as for recovering corrupted
NTFS devices.

The project is available at:

  https://github.com/ntfsprogs-plus/ntfsprogs-plus


Supported mount options
=======================

The NTFS driver supports the following mount options:

======================= ====================================================
iocharset=name          Character set to use for converting between
                        the encoding is used for user visible filename and
                        16 bit Unicode characters.

nls=name                Deprecated option.  Still supported but please use
                        iocharset=name in the future.

uid=
gid=
umask=                  Provide default owner, group, and access mode mask.
                        These options work as documented in mount(8).  By
                        default, the files/directories are owned by root
                        and he/she has read and write permissions, as well
                        as browse permission for directories.  No one else
                        has any access permissions.  I.e. the mode on all
                        files is by default rw------- and
                        for directories rwx------, a consequence of
                        the default fmask=0177 and dmask=0077.
                        Using a umask of zero will grant all permissions to
                        everyone, i.e. all files and directories will have
                        mode rwxrwxrwx.

fmask=
dmask=                  Instead of specifying umask which applies both to
                        files and directories, fmask applies only to files
                        and dmask only to directories.

showmeta=<BOOL>
show_sys_files=<BOOL>   If show_sys_files is specified, show the system
                        files in directory listings.  Otherwise the default
                        behaviour is to hide the system files.
                        Note that even when show_sys_files is specified,
                        "$MFT" will not be visible due to bugs/mis-features
                        in glibc. Further, note that irrespective of
                        show_sys_files, all files are accessible by name,
                        i.e. you can always do "ls -l \$UpCase" for example
                        to specifically show the system file containing
                        the Unicode upcase table.

case_sensitive=<BOOL>   If case_sensitive is specified, treat all filenames
                        as case sensitive and create file names in
                        the POSIX namespace (default behavior). Note,
                        the Linux NTFS driver will never create short
                        filenames and will remove them on rename/delete of
                        the corresponding long file name. Note that files
                        remain accessible via their short file name, if it
                        exists.

nocase=<BOOL>           If nocase is specified, treat filenames
                        case-insensitively.

disable_sparse=<BOOL>   If disable_sparse is specified, creation of sparse
                        regions, i.e. holes, inside files is disabled for
                        the volume (for the duration of this mount only).
                        By default, creation of sparse regions is enabled,
                        which is consistent with the behaviour of
                        traditional Unix filesystems.

errors=opt              Specify NTFS behavior on critical errors: panic,
                        remount the partition in read-only mode or
                        continue without doing anything (default behavior).

mft_zone_multiplier=    Set the MFT zone multiplier for the volume (this
                        setting is not persistent across mounts and can be
                        changed from mount to mount but cannot be changed
                        on remount).  Values of 1 to 4 are allowed, 1 being
                        the default.  The MFT zone multiplier determines
                        how much space is reserved for the MFT on the
                        volume.  If all other space is used up, then the
                        MFT zone will be shrunk dynamically, so this has no
                        impact on the amount of free space.  However, it
                        can have an impact on performance by affecting
                        fragmentation of the MFT. In general use the
                        default.  If you have a lot of small files then use
                        a higher value.  The values have the following
                        meaning:

                        =====   =================================
                        Value   MFT zone size (% of volume size)
                        =====   =================================
                          1             12.5%
                          2             25%
                          3             37.5%
                          4             50%
                        =====   =================================

                        Note this option is irrelevant for read-only mount.

preallocated_size=      Set preallocated size to optimize runlist merge
                        overhead with small chunck size.(64KB size by
                        default)

acl=<BOOL>              Enable POSIX ACL support. When specified, POSIX
                        ACLs stored in extended attributes are enforced.
                        Default is off. Requires kernel config
                        NTFS_FS_POSIX_ACL enabled.

sys_immutable=<BOOL>    Make NTFS system files (e.g. $MFT, $LogFile,
                        $Bitmap, $UpCase, etc.) immutable to user initiated
                        modifications for extra safety. Default is off.

nohidden=<BOOL>         Hide files and directories marked with the Windows
                        "hidden" attribute. By default hidden items are
                        shown.

hide_dot_files=<BOOL>   Hide names beginning with a dot ("."). By default
                        dot files are shown. When enabled, files and
                        directories created with a leading '.' will be
                        hidden from directory listings.

windows_names=<BOOL>    Refuse creation/rename of files with characters or
                        reserved device names disallowed on Windows (e.g.
                        CON, NUL, AUX, COM1, LPT1, etc.). Default is off.
discard=<BOOL>          Issue block device discard for clusters freed on
                        file deletion/truncation to inform underlying
                        storage.
======================= ====================================================
+9 −0
Original line number Diff line number Diff line
@@ -18997,6 +18997,15 @@ W: https://github.com/davejiang/linux/wiki
T:	git https://github.com/davejiang/linux.git
F:	drivers/ntb/hw/intel/
NTFS FILESYSTEM
M:	Namjae Jeon <linkinjeon@kernel.org>
M:	Hyunchul Lee <hyc.lee@gmail.com>
L:	linux-fsdevel@vger.kernel.org
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git
F:	Documentation/filesystems/ntfs.rst
F:	fs/ntfs/
NTFS3 FILESYSTEM
M:	Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
L:	ntfs3@lists.linux.dev
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"

source "fs/fat/Kconfig"
source "fs/exfat/Kconfig"
source "fs/ntfs/Kconfig"
source "fs/ntfs3/Kconfig"

endmenu
Loading