Skip to content

Commit f746406

Browse files
committed
Merge git://github.com/Paragon-Software-Group/linux-ntfs3
Merge NTFSv3 filesystem from Konstantin Komarov: "This patch adds NTFS Read-Write driver to fs/ntfs3. Having decades of expertise in commercial file systems development and huge test coverage, we at Paragon Software GmbH want to make our contribution to the Open Source Community by providing implementation of NTFS Read-Write driver for the Linux Kernel. This is fully functional NTFS Read-Write driver. Current version works with NTFS (including v3.1) and normal/compressed/sparse files and supports journal replaying. We plan to support this version after the codebase once merged, and add new features and fix bugs. For example, full journaling support over JBD will be added in later updates" Link: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/lkml/[email protected]/ * git://github.com/Paragon-Software-Group/linux-ntfs3: (35 commits) fs/ntfs3: Change how module init/info messages are displayed fs/ntfs3: Remove GPL boilerplates from decompress lib files fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter fs/ntfs3: Fix integer overflow in ni_fiemap with fiemap_prep() fs/ntfs3: Restyle comments to better align with kernel-doc fs/ntfs3: Rework file operations fs/ntfs3: Remove fat ioctl's from ntfs3 driver for now fs/ntfs3: Restyle comments to better align with kernel-doc fs/ntfs3: Fix error handling in indx_insert_into_root() fs/ntfs3: Potential NULL dereference in hdr_find_split() fs/ntfs3: Fix error code in indx_add_allocate() fs/ntfs3: fix an error code in ntfs_get_acl_ex() fs/ntfs3: add checks for allocation failure fs/ntfs3: Use kcalloc/kmalloc_array over kzalloc/kmalloc fs/ntfs3: Do not use driver own alloc wrappers fs/ntfs3: Use kernel ALIGN macros over driver specific fs/ntfs3: Restyle comment block in ni_parse_reparse() fs/ntfs3: Remove unused including <linux/version.h> fs/ntfs3: Fix fall-through warnings for Clang fs/ntfs3: Fix one none utf8 char in source file ...
2 parents 6abaa83 + 2e3a51b commit f746406

33 files changed

+31018
-0
lines changed

Documentation/filesystems/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Documentation for filesystem implementations.
101101
nilfs2
102102
nfs/index
103103
ntfs
104+
ntfs3
104105
ocfs2
105106
ocfs2-online-filecheck
106107
omfs

Documentation/filesystems/ntfs3.rst

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=====
4+
NTFS3
5+
=====
6+
7+
8+
Summary and Features
9+
====================
10+
11+
NTFS3 is fully functional NTFS Read-Write driver. The driver works with
12+
NTFS versions up to 3.1, normal/compressed/sparse files
13+
and journal replaying. File system type to use on mount is 'ntfs3'.
14+
15+
- This driver implements NTFS read/write support for normal, sparse and
16+
compressed files.
17+
- Supports native journal replaying;
18+
- Supports extended attributes
19+
Predefined extended attributes:
20+
- 'system.ntfs_security' gets/sets security
21+
descriptor (SECURITY_DESCRIPTOR_RELATIVE)
22+
- 'system.ntfs_attrib' gets/sets ntfs file/dir attributes.
23+
Note: applied to empty files, this allows to switch type between
24+
sparse(0x200), compressed(0x800) and normal;
25+
- Supports NFS export of mounted NTFS volumes.
26+
27+
Mount Options
28+
=============
29+
30+
The list below describes mount options supported by NTFS3 driver in addition to
31+
generic ones.
32+
33+
===============================================================================
34+
35+
nls=name This option informs the driver how to interpret path
36+
strings and translate them to Unicode and back. If
37+
this option is not set, the default codepage will be
38+
used (CONFIG_NLS_DEFAULT).
39+
Examples:
40+
'nls=utf8'
41+
42+
uid=
43+
gid=
44+
umask= Controls the default permissions for files/directories created
45+
after the NTFS volume is mounted.
46+
47+
fmask=
48+
dmask= Instead of specifying umask which applies both to
49+
files and directories, fmask applies only to files and
50+
dmask only to directories.
51+
52+
nohidden Files with the Windows-specific HIDDEN (FILE_ATTRIBUTE_HIDDEN)
53+
attribute will not be shown under Linux.
54+
55+
sys_immutable Files with the Windows-specific SYSTEM
56+
(FILE_ATTRIBUTE_SYSTEM) attribute will be marked as system
57+
immutable files.
58+
59+
discard Enable support of the TRIM command for improved performance
60+
on delete operations, which is recommended for use with the
61+
solid-state drives (SSD).
62+
63+
force Forces the driver to mount partitions even if 'dirty' flag
64+
(volume dirty) is set. Not recommended for use.
65+
66+
sparse Create new files as "sparse".
67+
68+
showmeta Use this parameter to show all meta-files (System Files) on
69+
a mounted NTFS partition.
70+
By default, all meta-files are hidden.
71+
72+
prealloc Preallocate space for files excessively when file size is
73+
increasing on writes. Decreases fragmentation in case of
74+
parallel write operations to different files.
75+
76+
no_acs_rules "No access rules" mount option sets access rights for
77+
files/folders to 777 and owner/group to root. This mount
78+
option absorbs all other permissions:
79+
- permissions change for files/folders will be reported
80+
as successful, but they will remain 777;
81+
- owner/group change will be reported as successful, but
82+
they will stay as root
83+
84+
acl Support POSIX ACLs (Access Control Lists). Effective if
85+
supported by Kernel. Not to be confused with NTFS ACLs.
86+
The option specified as acl enables support for POSIX ACLs.
87+
88+
noatime All files and directories will not update their last access
89+
time attribute if a partition is mounted with this parameter.
90+
This option can speed up file system operation.
91+
92+
===============================================================================
93+
94+
ToDo list
95+
=========
96+
97+
- Full journaling support (currently journal replaying is supported) over JBD.
98+
99+
100+
References
101+
==========
102+
https://www.paragon-software.com/home/ntfs-linux-professional/
103+
- Commercial version of the NTFS driver for Linux.
104+
105+
106+
- Direct e-mail address for feedback and requests on the NTFS3 implementation.

MAINTAINERS

+9
Original file line numberDiff line numberDiff line change
@@ -13340,6 +13340,15 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs.git
1334013340
F: Documentation/filesystems/ntfs.rst
1334113341
F: fs/ntfs/
1334213342

13343+
NTFS3 FILESYSTEM
13344+
M: Konstantin Komarov <[email protected]>
13345+
13346+
S: Supported
13347+
W: http://www.paragon-software.com/
13348+
T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git
13349+
F: Documentation/filesystems/ntfs3.rst
13350+
F: fs/ntfs3/
13351+
1334313352
NUBUS SUBSYSTEM
1334413353
M: Finn Thain <[email protected]>
1334513354

fs/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
136136
source "fs/fat/Kconfig"
137137
source "fs/exfat/Kconfig"
138138
source "fs/ntfs/Kconfig"
139+
source "fs/ntfs3/Kconfig"
139140

140141
endmenu
141142
endif # BLOCK

fs/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ obj-$(CONFIG_CIFS) += cifs/
101101
obj-$(CONFIG_SMB_SERVER) += ksmbd/
102102
obj-$(CONFIG_HPFS_FS) += hpfs/
103103
obj-$(CONFIG_NTFS_FS) += ntfs/
104+
obj-$(CONFIG_NTFS3_FS) += ntfs3/
104105
obj-$(CONFIG_UFS_FS) += ufs/
105106
obj-$(CONFIG_EFS_FS) += efs/
106107
obj-$(CONFIG_JFFS2_FS) += jffs2/

fs/ntfs3/Kconfig

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config NTFS3_FS
3+
tristate "NTFS Read-Write file system support"
4+
select NLS
5+
help
6+
Windows OS native file system (NTFS) support up to NTFS version 3.1.
7+
8+
Y or M enables the NTFS3 driver with full features enabled (read,
9+
write, journal replaying, sparse/compressed files support).
10+
File system type to use on mount is "ntfs3". Module name (M option)
11+
is also "ntfs3".
12+
13+
Documentation: <file:Documentation/filesystems/ntfs3.rst>
14+
15+
config NTFS3_64BIT_CLUSTER
16+
bool "64 bits per NTFS clusters"
17+
depends on NTFS3_FS && 64BIT
18+
help
19+
Windows implementation of ntfs.sys uses 32 bits per clusters.
20+
If activated 64 bits per clusters you will be able to use 4k cluster
21+
for 16T+ volumes. Windows will not be able to mount such volumes.
22+
23+
It is recommended to say N here.
24+
25+
config NTFS3_LZX_XPRESS
26+
bool "activate support of external compressions lzx/xpress"
27+
depends on NTFS3_FS
28+
help
29+
In Windows 10 one can use command "compact" to compress any files.
30+
4 possible variants of compression are: xpress4k, xpress8k, xpress16k and lzx.
31+
If activated you will be able to read such files correctly.
32+
33+
It is recommended to say Y here.
34+
35+
config NTFS3_FS_POSIX_ACL
36+
bool "NTFS POSIX Access Control Lists"
37+
depends on NTFS3_FS
38+
select FS_POSIX_ACL
39+
help
40+
POSIX Access Control Lists (ACLs) support additional access rights
41+
for users and groups beyond the standard owner/group/world scheme,
42+
and this option selects support for ACLs specifically for ntfs
43+
filesystems.
44+
NOTE: this is linux only feature. Windows will ignore these ACLs.
45+
46+
If you don't know what Access Control Lists are, say N.

fs/ntfs3/Makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
#
3+
# Makefile for the ntfs3 filesystem support.
4+
#
5+
6+
# to check robot warnings
7+
ccflags-y += -Wint-to-pointer-cast \
8+
$(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \
9+
$(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)
10+
11+
obj-$(CONFIG_NTFS3_FS) += ntfs3.o
12+
13+
ntfs3-y := attrib.o \
14+
attrlist.o \
15+
bitfunc.o \
16+
bitmap.o \
17+
dir.o \
18+
fsntfs.o \
19+
frecord.o \
20+
file.o \
21+
fslog.o \
22+
inode.o \
23+
index.o \
24+
lznt.o \
25+
namei.o \
26+
record.o \
27+
run.o \
28+
super.o \
29+
upcase.o \
30+
xattr.o
31+
32+
ntfs3-$(CONFIG_NTFS3_LZX_XPRESS) += $(addprefix lib/,\
33+
decompress_common.o \
34+
lzx_decompress.o \
35+
xpress_decompress.o \
36+
)

0 commit comments

Comments
 (0)