ntfs filesystem remake
Subsystems (4)
Re: [PATCH v3 12/14] Revert: ntfs3: serve as alias for the legacy ntfs driver
In reply to Namjae JeonQuoted 3 lines · Namjae Jeon
ntfs filesystem has been remade and is returning as a new implementation. ntfs3 no longer needs to be an alias for ntfs.
This is not a clear revert of74871791ffa95 ntfs3: serve as alias for the legacy ntfs driver
So what is it? please include the description in the commit message.
Thanks,
Amir.
Quoted 248 lines
Signed-off-by Namjae Jeon <[email protected]>--- fs/ntfs3/Kconfig | 9 -------- fs/ntfs3/dir.c | 9 -------- fs/ntfs3/file.c | 10 --------- fs/ntfs3/inode.c | 16 ++++---------- fs/ntfs3/ntfs_fs.h | 11 ---------- fs/ntfs3/super.c | 52 ---------------------------------------------- 6 files changed, 4 insertions(+), 103 deletions(-)fs/ntfs3/Kconfig +0
-9@@ -46,12 +46,3 @@ config NTFS3_FS_POSIX_ACL NOTE: this is linux only feature. Windows will ignore these ACLs. If you don't know what Access Control Lists are, say N. - -config NTFS_FS - tristate "NTFS file system support" - select NTFS3_FS - select BUFFER_HEAD - select NLS - help - This config option is here only for backward compatibility. NTFS - filesystem is now handled by the NTFS3 driver.fs/ntfs3/dir.c +0
-9@@ -631,13 +631,4 @@ const struct file_operations ntfs_dir_operations = { .compat_ioctl = ntfs_compat_ioctl,#endif }; - -#if IS_ENABLED (CONFIG_NTFS_FS ) -const struct file_operations ntfs_legacy_dir_operations = { - .llseek = generic_file_llseek, - .read = generic_read_dir, - .iterate_shared = ntfs_readdir, - .open = ntfs_file_open, -}; -#endif // clang-format on fs/ntfs3/file.c +0
-10@@ -1478,14 +1478,4 @@ const struct file_operations ntfs_file_operations = { .fallocate = ntfs_fallocate, .release = ntfs_file_release, }; - -#if IS_ENABLED (CONFIG_NTFS_FS ) -const struct file_operations ntfs_legacy_file_operations = { - .llseek = generic_file_llseek, - .read_iter = ntfs_file_read_iter, - .splice_read = ntfs_file_splice_read, - .open = ntfs_file_open, - .release = ntfs_file_release, -}; -#endif // clang-format on fs/ntfs3/inode.c +4
-12@@ -444,9 +444,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,* Usually a hard links to directories are disabled. */ inode->i_op = &ntfs_dir_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_dir_operations : - &ntfs_dir_operations; + inode->i_fop = &ntfs_dir_operations; ni->i_valid =0 ; }else if (S_ISLNK (mode)) { ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY ;@@ -456,9 +454,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, }else if (S_ISREG (mode)) { ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY ; inode->i_op = &ntfs_file_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_file_operations : - &ntfs_file_operations; + inode->i_fop = &ntfs_file_operations; inode->i_mapping->a_ops =is_compressed (ni) ? &ntfs_aops_cmpr : &ntfs_aops;if (ino !=MFT_REC_MFT )@@ -1590,9 +1586,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,if (S_ISDIR (mode)) { inode->i_op = &ntfs_dir_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_dir_operations : - &ntfs_dir_operations; + inode->i_fop = &ntfs_dir_operations; }else if (S_ISLNK (mode)) { inode->i_op = &ntfs_link_inode_operations; inode->i_fop =NULL ;@@ -1601,9 +1595,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,inode_nohighmem (inode); }else if (S_ISREG (mode)) { inode->i_op = &ntfs_file_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_file_operations : - &ntfs_file_operations; + inode->i_fop = &ntfs_file_operations; inode->i_mapping->a_ops =is_compressed (ni) ? &ntfs_aops_cmpr : &ntfs_aops;init_rwsem (&ni->file.run_lock);fs/ntfs3/ntfs_fs.h +0
-11@@ -501,7 +501,6 @@ struct inode *dir_search_u(struct inode *dir, const struct cpu_str *uni, struct ntfs_fnd *fnd);bool dir_is_empty (struct inode *dir);extern const struct file_operations ntfs_dir_operations; -extern const struct file_operations ntfs_legacy_dir_operations;/* Globals from file.c */ int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,@@ -516,7 +515,6 @@ long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg);extern const struct inode_operations ntfs_special_inode_operations;extern const struct inode_operations ntfs_file_inode_operations;extern const struct file_operations ntfs_file_operations; -extern const struct file_operations ntfs_legacy_file_operations;/* Globals from frecord.c */ void ni_remove_mi (struct ntfs_inode *ni,struct mft_inode *mi);@@ -1160,13 +1158,4 @@ static inline void le64_sub_cpu(__le64 *var, u64 val) *var = cpu_to_le64(le64_to_cpu(*var) - val); } -#if IS_ENABLED (CONFIG_NTFS_FS ) -bool is_legacy_ntfs (struct super_block *sb); -#else -static inline bool is_legacy_ntfs (struct super_block *sb) -{ -return false; -} -#endif -#endif /* _LINUX_NTFS3_NTFS_FS_H */ fs/ntfs3/super.c +0
-53@@ -415,12 +415,6 @@ static int ntfs_fs_reconfigure(struct fs_context *fc)struct ntfs_mount_options *new_opts = fc->fs_private;int ro_rw; -/* If ntfs3 is used as legacy ntfs enforce read-only mode. */ -if (is_legacy_ntfs (sb)) { - fc->sb_flags |=SB_RDONLY ; - goto out; - } - ro_rw =sb_rdonly (sb) && !(fc->sb_flags &SB_RDONLY );if (ro_rw && (sbi->flags &NTFS_FLAGS_NEED_REPLAY )) { errorf(fc,@@ -447,7 +441,6 @@ static int ntfs_fs_reconfigure(struct fs_context *fc)return -EINVAL ; } -out:sync_filesystem (sb);swap (sbi->options, fc->fs_private);@@ -1670,8 +1663,6 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)ntfs_create_procdir (sb); -if (is_legacy_ntfs (sb)) - sb->s_flags |=SB_RDONLY ;return 0 ; put_inode_out:@@ -1876,47 +1867,6 @@ static struct file_system_type ntfs_fs_type = { .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, }; -#if IS_ENABLED (CONFIG_NTFS_FS ) -static int ntfs_legacy_init_fs_context (struct fs_context *fc) -{ -int ret; - - ret =__ntfs_init_fs_context (fc); -/* If ntfs3 is used as legacy ntfs enforce read-only mode. */ - fc->sb_flags |=SB_RDONLY ; -return ret; -} - -static struct file_system_type ntfs_legacy_fs_type = { - .owner =THIS_MODULE , - .name ="ntfs" , - .init_fs_context = ntfs_legacy_init_fs_context, - .parameters = ntfs_fs_parameters, - .kill_sb = ntfs3_kill_sb, - .fs_flags =FS_REQUIRES_DEV |FS_ALLOW_IDMAP , -}; -MODULE_ALIAS_FS ("ntfs" ); - -static inline void register_as_ntfs_legacy (void ) -{ -int err =register_filesystem (&ntfs_legacy_fs_type); -if (err) -pr_warn ("ntfs3: Failed to register legacy ntfs filesystem driver: %d\n" , err); -} - -static inline void unregister_as_ntfs_legacy (void ) -{ -unregister_filesystem (&ntfs_legacy_fs_type); -} -bool is_legacy_ntfs (struct super_block *sb) -{ -return sb->s_type == &ntfs_legacy_fs_type; -} -#else -static inline void register_as_ntfs_legacy (void ) {} -static inline void unregister_as_ntfs_legacy (void ) {} -#endif -// clang-format on static int __init init_ntfs_fs (void )@@ -1945,7 +1895,6 @@ static int __init init_ntfs_fs(void) goto out1; } -register_as_ntfs_legacy (); err =register_filesystem (&ntfs_fs_type);if (err) goto out;@@ -1965,7 +1914,6 @@ static void __exit exit_ntfs_fs(void)rcu_barrier ();kmem_cache_destroy (ntfs_inode_cachep);unregister_filesystem (&ntfs_fs_type); -unregister_as_ntfs_legacy ();ntfs3_exit_bitmap ();ntfs_remove_proc_root (); } --2.25.1
Namjae Jeon
maintainerRe: [PATCH v3 12/14] Revert: ntfs3: serve as alias for the legacy ntfs driver
Quoted 8 lines · Amir Goldstein
Quoted 3 lines · Namjae Jeon
ntfs filesystem has been remade and is returning as a new implementation. ntfs3 no longer needs to be an alias for ntfs.
This is not a clear revert of
74871791ffa95ntfs3: serve as alias for the legacy ntfs driver
Three other ntfs-related patches also needed to be reverted.
1ff2e956608c fs/ntfs3: Redesign legacy ntfs support 9b872cc50daa ntfs3: add legacy ntfs file operations d55f90e9b243 ntfs3: enforce read-only when used as legacy ntfs driver
I wanted to remove ntfs legacy codes all at once.
Quoted 2 lines
So what is it? please include the description in the commit message.
Okay, I will do that.
Thanks!
Quoted 252 lines
Thanks,
Amir.Quoted 248 lines
Signed-off-by Namjae Jeon <[email protected]>--- fs/ntfs3/Kconfig | 9 -------- fs/ntfs3/dir.c | 9 -------- fs/ntfs3/file.c | 10 --------- fs/ntfs3/inode.c | 16 ++++---------- fs/ntfs3/ntfs_fs.h | 11 ---------- fs/ntfs3/super.c | 52 ---------------------------------------------- 6 files changed, 4 insertions(+), 103 deletions(-)fs/ntfs3/Kconfig +0
-9@@ -46,12 +46,3 @@ config NTFS3_FS_POSIX_ACL NOTE: this is linux only feature. Windows will ignore these ACLs. If you don't know what Access Control Lists are, say N. - -config NTFS_FS - tristate "NTFS file system support" - select NTFS3_FS - select BUFFER_HEAD - select NLS - help - This config option is here only for backward compatibility. NTFS - filesystem is now handled by the NTFS3 driver.fs/ntfs3/dir.c +0
-9@@ -631,13 +631,4 @@ const struct file_operations ntfs_dir_operations = { .compat_ioctl = ntfs_compat_ioctl,#endif }; - -#if IS_ENABLED (CONFIG_NTFS_FS ) -const struct file_operations ntfs_legacy_dir_operations = { - .llseek = generic_file_llseek, - .read = generic_read_dir, - .iterate_shared = ntfs_readdir, - .open = ntfs_file_open, -}; -#endif // clang-format on fs/ntfs3/file.c +0
-10@@ -1478,14 +1478,4 @@ const struct file_operations ntfs_file_operations = { .fallocate = ntfs_fallocate, .release = ntfs_file_release, }; - -#if IS_ENABLED (CONFIG_NTFS_FS ) -const struct file_operations ntfs_legacy_file_operations = { - .llseek = generic_file_llseek, - .read_iter = ntfs_file_read_iter, - .splice_read = ntfs_file_splice_read, - .open = ntfs_file_open, - .release = ntfs_file_release, -}; -#endif // clang-format on fs/ntfs3/inode.c +4
-12@@ -444,9 +444,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,* Usually a hard links to directories are disabled. */ inode->i_op = &ntfs_dir_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_dir_operations : - &ntfs_dir_operations; + inode->i_fop = &ntfs_dir_operations; ni->i_valid =0 ; }else if (S_ISLNK (mode)) { ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY ;@@ -456,9 +454,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, }else if (S_ISREG (mode)) { ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY ; inode->i_op = &ntfs_file_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_file_operations : - &ntfs_file_operations; + inode->i_fop = &ntfs_file_operations; inode->i_mapping->a_ops =is_compressed (ni) ? &ntfs_aops_cmpr : &ntfs_aops;if (ino !=MFT_REC_MFT )@@ -1590,9 +1586,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,if (S_ISDIR (mode)) { inode->i_op = &ntfs_dir_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_dir_operations : - &ntfs_dir_operations; + inode->i_fop = &ntfs_dir_operations; }else if (S_ISLNK (mode)) { inode->i_op = &ntfs_link_inode_operations; inode->i_fop =NULL ;@@ -1601,9 +1595,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,inode_nohighmem (inode); }else if (S_ISREG (mode)) { inode->i_op = &ntfs_file_inode_operations; - inode->i_fop =unlikely (is_legacy_ntfs (sb)) ? - &ntfs_legacy_file_operations : - &ntfs_file_operations; + inode->i_fop = &ntfs_file_operations; inode->i_mapping->a_ops =is_compressed (ni) ? &ntfs_aops_cmpr : &ntfs_aops;init_rwsem (&ni->file.run_lock);fs/ntfs3/ntfs_fs.h +0
-11@@ -501,7 +501,6 @@ struct inode *dir_search_u(struct inode *dir, const struct cpu_str *uni, struct ntfs_fnd *fnd);bool dir_is_empty (struct inode *dir);extern const struct file_operations ntfs_dir_operations; -extern const struct file_operations ntfs_legacy_dir_operations;/* Globals from file.c */ int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,@@ -516,7 +515,6 @@ long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg);extern const struct inode_operations ntfs_special_inode_operations;extern const struct inode_operations ntfs_file_inode_operations;extern const struct file_operations ntfs_file_operations; -extern const struct file_operations ntfs_legacy_file_operations;/* Globals from frecord.c */ void ni_remove_mi (struct ntfs_inode *ni,struct mft_inode *mi);@@ -1160,13 +1158,4 @@ static inline void le64_sub_cpu(__le64 *var, u64 val) *var = cpu_to_le64(le64_to_cpu(*var) - val); } -#if IS_ENABLED (CONFIG_NTFS_FS ) -bool is_legacy_ntfs (struct super_block *sb); -#else -static inline bool is_legacy_ntfs (struct super_block *sb) -{ -return false; -} -#endif -#endif /* _LINUX_NTFS3_NTFS_FS_H */ fs/ntfs3/super.c +0
-53@@ -415,12 +415,6 @@ static int ntfs_fs_reconfigure(struct fs_context *fc)struct ntfs_mount_options *new_opts = fc->fs_private;int ro_rw; -/* If ntfs3 is used as legacy ntfs enforce read-only mode. */ -if (is_legacy_ntfs (sb)) { - fc->sb_flags |=SB_RDONLY ; - goto out; - } - ro_rw =sb_rdonly (sb) && !(fc->sb_flags &SB_RDONLY );if (ro_rw && (sbi->flags &NTFS_FLAGS_NEED_REPLAY )) { errorf(fc,@@ -447,7 +441,6 @@ static int ntfs_fs_reconfigure(struct fs_context *fc)return -EINVAL ; } -out:sync_filesystem (sb);swap (sbi->options, fc->fs_private);@@ -1670,8 +1663,6 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)ntfs_create_procdir (sb); -if (is_legacy_ntfs (sb)) - sb->s_flags |=SB_RDONLY ;return 0 ; put_inode_out:@@ -1876,47 +1867,6 @@ static struct file_system_type ntfs_fs_type = { .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, }; -#if IS_ENABLED (CONFIG_NTFS_FS ) -static int ntfs_legacy_init_fs_context (struct fs_context *fc) -{ -int ret; - - ret =__ntfs_init_fs_context (fc); -/* If ntfs3 is used as legacy ntfs enforce read-only mode. */ - fc->sb_flags |=SB_RDONLY ; -return ret; -} - -static struct file_system_type ntfs_legacy_fs_type = { - .owner =THIS_MODULE , - .name ="ntfs" , - .init_fs_context = ntfs_legacy_init_fs_context, - .parameters = ntfs_fs_parameters, - .kill_sb = ntfs3_kill_sb, - .fs_flags =FS_REQUIRES_DEV |FS_ALLOW_IDMAP , -}; -MODULE_ALIAS_FS ("ntfs" ); - -static inline void register_as_ntfs_legacy (void ) -{ -int err =register_filesystem (&ntfs_legacy_fs_type); -if (err) -pr_warn ("ntfs3: Failed to register legacy ntfs filesystem driver: %d\n" , err); -} - -static inline void unregister_as_ntfs_legacy (void ) -{ -unregister_filesystem (&ntfs_legacy_fs_type); -} -bool is_legacy_ntfs (struct super_block *sb) -{ -return sb->s_type == &ntfs_legacy_fs_type; -} -#else -static inline void register_as_ntfs_legacy (void ) {} -static inline void unregister_as_ntfs_legacy (void ) {} -#endif -// clang-format on static int __init init_ntfs_fs (void )@@ -1945,7 +1895,6 @@ static int __init init_ntfs_fs(void) goto out1; } -register_as_ntfs_legacy (); err =register_filesystem (&ntfs_fs_type);if (err) goto out;@@ -1965,7 +1914,6 @@ static void __exit exit_ntfs_fs(void)rcu_barrier ();kmem_cache_destroy (ntfs_inode_cachep);unregister_filesystem (&ntfs_fs_type); -unregister_as_ntfs_legacy ();ntfs3_exit_bitmap ();ntfs_remove_proc_root (); } --2.25.1
Re: [PATCH v3 12/14] Revert: ntfs3: serve as alias for the legacy ntfs driver
In reply to Namjae JeonQuoted 2 lines · Namjae Jeon
ntfs filesystem has been remade and is returning as a new implementation. ntfs3 no longer needs to be an alias for ntfs.
I don't think this is right. If one has selected ntfs3 as built-in then one still needs pieces of this to handle classic ntfs configurations, no?
Namjae Jeon
maintainerRe: [PATCH v3 12/14] Revert: ntfs3: serve as alias for the legacy ntfs driver
Quoted 8 lines · Matthew Wilcox
Quoted 2 lines · Namjae Jeon
ntfs filesystem has been remade and is returning as a new implementation. ntfs3 no longer needs to be an alias for ntfs.
I don't think this is right. If one has selected ntfs3 as built-in then one still needs pieces of this to handle classic ntfs configurations, no?
ntfsplus has been renamed to ntfs as you requested. Wouldn't it be confusing for users if they probably expect the new read-write implementation to be used, but instead the read-only path from ntfs3 could be triggered ?
Namjae Jeon
maintainerRe: [PATCH v3 12/14] Revert: ntfs3: serve as alias for the legacy ntfs driver
Quoted 7 lines · Namjae Jeon
Quoted 5 lines · Matthew Wilcox
Quoted 2 lines · Namjae Jeon
ntfs filesystem has been remade and is returning as a new implementation. ntfs3 no longer needs to be an alias for ntfs.
Quoted 7 lines
Quoted 3 lines
I don't think this is right. If one has selected ntfs3 as built-in then one still needs pieces of this to handle classic ntfs configurations, no?
ntfsplus has been renamed to ntfs as you requested. Wouldn't it be confusing for users if they probably expect the new read-write implementation to be used, but instead the read-only path from ntfs3 could be triggered ?
And, if ntfs3 is built-in or already insmoded, they can not be used simultaneously because ntfs.ko cannot be insmoded.
Namjae Jeon
maintainerPATCH v3 13/14 ntfs: add Kconfig and Makefile
In reply to Namjae JeonThis adds the Kconfig and Makefile
--- fs/Kconfig | 18 ++++++++++++++++++ fs/Makefile | 1 + fs/ntfs/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++++ fs/ntfs/Makefile | 18 ++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 fs/ntfs/Kconfig create mode 100644 fs/ntfs/Makefile
fs/Kconfig +18 -0
@@ -152,8 +152,26 @@ menu "DOS/FAT/EXFAT/NT Filesystems" source "fs/fat/Kconfig" source "fs/exfat/Kconfig" +source "fs/ntfs/Kconfig" source "fs/ntfs3/Kconfig" +choice + prompt "Select built-in NTFS filesystem (only one can be built-in)" + default DEFAULT_NTFS + help + Only one NTFS can be built into the kernel(y) when selecting a + specific default. Both can still be built as modules(m). + + config DEFAULT_NTFS_NONE + bool "No built-in restriction (allows both drivers as 'y')" + + config DEFAULT_NTFS + bool "NTFS" + + config DEFAULT_NTFS3 + bool "NTFS3" +endchoice + endmenu endif # BLOCK
fs/Makefile +1 -0
@@ -90,6 +90,7 @@ obj-$(CONFIG_NLS) += nls/ obj-y += unicode/ obj-$(CONFIG_SMBFS) += smb/ obj-$(CONFIG_HPFS_FS) += hpfs/ +obj-$(CONFIG_NTFS_FS) += ntfs/ obj-$(CONFIG_NTFS3_FS) += ntfs3/ obj-$(CONFIG_UFS_FS) += ufs/ obj-$(CONFIG_EFS_FS) += efs/
fs/ntfs/Kconfig new file +46 -0
46 lines not on this page · raw message
fs/ntfs/Makefile new file +18 -0
@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the ntfs filesystem support. +# + +# to check robot warnings +ccflags-y += -Wint-to-pointer-cast \ + $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \ + $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration) + +obj-$(CONFIG_NTFS_FS) += ntfs.o + +ntfs-y := aops.o attrib.o collate.o dir.o file.o index.o inode.o \ + mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \ + upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \ + iomap.o debug.o sysctl.o quota.o + +ccflags-$(CONFIG_NTFS_DEBUG) += -DDEBUG
Signature · 1 line
2.25.1
Re: [PATCH v3 13/14] ntfs: add Kconfig and Makefile
Quoted 2 lines · Namjae Jeon
This adds the
KconfigandMakefile
Worth throwing in a word about the mutual exclusiveness of ntfs/ntfs3 as built in default driver.
Quoted 21 lines
Signed-off-by Namjae Jeon <[email protected]>--- fs/Kconfig | 18 ++++++++++++++++++ fs/Makefile | 1 + fs/ntfs/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++++ fs/ntfs/Makefile | 18 ++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 fs/ntfs/Kconfig create mode 100644 fs/ntfs/Makefilefs/Kconfig +1
-0@@ -152,8 +152,26 @@ menu "DOS/FAT/EXFAT/NT Filesystems" source "fs/fat/Kconfig" source "fs/exfat/Kconfig" +source "fs/ntfs/Kconfig" source "fs/ntfs3/Kconfig"
fs/Kconfig menu "DOS/FAT/EXFAT/NT Filesystems" · line 166
Quoted 10 lines
fs/Kconfig +9
-0+choice + prompt "Select built-in NTFS filesystem (only one can be built-in)" + default DEFAULT_NTFS + help + Only one NTFS can be built into the kernel(y) when selecting a + specific default. Both can still be built as modules(m). + + config DEFAULT_NTFS_NONE + bool "No built-in restriction (allows both drivers as 'y')"
as m?
Quoted 29 lines
fs/Kconfig +8
-0+ + config DEFAULT_NTFS + bool "NTFS" + + config DEFAULT_NTFS3 + bool "NTFS3" +endchoice + endmenu endif # BLOCKfs/Makefile +1
-0@@ -90,6 +90,7 @@ obj-$(CONFIG_NLS) += nls/ obj-y += unicode/ obj-$(CONFIG_SMBFS) += smb/ obj-$(CONFIG_HPFS_FS) += hpfs/ +obj-$(CONFIG_NTFS_FS) += ntfs/ obj-$(CONFIG_NTFS3_FS) += ntfs3/ obj-$(CONFIG_UFS_FS) += ufs/ obj-$(CONFIG_EFS_FS) += efs/fs/ntfs/Kconfig new file +0
-0
fs/ntfs/Kconfig line 4
Quoted 4 lines
fs/ntfs/Kconfig new file +4
-0@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only +config NTFS_FS + tristate "NTFS file system support" + depends on !DEFAULT_NTFS3 || m
I am not seeing similar change to fs/ntfs3/Kconfig
Thanks,
Amir.
Quoted 69 lines
fs/ntfs/Kconfig new file +42
-0+ select NLS + help + NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003. + This allows you to mount devices formatted with the ntfs file system. + + To compile this as a module, choose M here: the module will be called + ntfs. + +config NTFS_DEBUG + bool "NTFS debugging support" + depends on NTFS_FS + help + If you are experiencing any problems with the NTFS file system, say + Y here. This will result in additional consistency checks to be + performed by the driver as well as additional debugging messages to + be written to the system log. Note that debugging messages are + disabled by default. To enable them, supply the option debug_msgs=1 + at the kernel command line when booting the kernel or as an option + to insmod when loading the ntfs module. Once the driver is active, + you can enable debugging messages by doing (as root): + echo 1 > /proc/sys/fs/ntfs-debug + Replacing the "1" with "0" would disable debug messages. + + If you leave debugging messages disabled, this results in little + overhead, but enabling debug messages results in very significant + slowdown of the system. + + When reporting bugs, please try to have available a full dump of + debugging messages while the misbehaviour was occurring. + +config NTFS_FS_POSIX_ACL + bool "NTFS POSIX Access Control Lists" + depends on NTFS_FS + select FS_POSIX_ACL + help + POSIX Access Control Lists (ACLs) support additional access rights + for users and groups beyond the standard owner/group/world scheme, + and this option selects support for ACLs specifically for ntfs + filesystems. + NOTE: this is linux only feature. Windows will ignore these ACLs. + + If you don't know what Access Control Lists are, say N.fs/ntfs/Makefile new file +18
-1@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the ntfs filesystem support. +# + +# to check robot warnings +ccflags-y += -Wint-to-pointer-cast \ + $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \ + $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration) + +obj-$(CONFIG_NTFS_FS) += ntfs.o + +ntfs-y := aops.o attrib.o collate.o dir.o file.o index.o inode.o \ + mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \ + upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \ + iomap.o debug.o sysctl.o quota.o + +ccflags-$(CONFIG_NTFS_DEBUG) += -DDEBUG --2.25.1
Namjae Jeon
maintainerRe: [PATCH v3 13/14] ntfs: add Kconfig and Makefile
Quoted 7 lines · Amir Goldstein
Quoted 2 lines · Namjae Jeon
This adds the
KconfigandMakefileWorth throwing in a word about the mutual exclusiveness of ntfs/ntfs3 as built in default driver.
Okay, I will update it on v4.
Quoted 23 lines
Quoted 23 lines
Signed-off-by Namjae Jeon <[email protected]>--- fs/Kconfig | 18 ++++++++++++++++++ fs/Makefile | 1 + fs/ntfs/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++++ fs/ntfs/Makefile | 18 ++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 fs/ntfs/Kconfig create mode 100644 fs/ntfs/Makefilefs/Kconfig +1
-0@@ -152,8 +152,26 @@ menu "DOS/FAT/EXFAT/NT Filesystems" source "fs/fat/Kconfig" source "fs/exfat/Kconfig" +source "fs/ntfs/Kconfig" source "fs/ntfs3/Kconfig"
Quoted 11 lines
fs/Kconfig menu "DOS/FAT/EXFAT/NT Filesystems" · line 166
Quoted 9 lines
fs/Kconfig +9
-0+choice + prompt "Select built-in NTFS filesystem (only one can be built-in)" + default DEFAULT_NTFS + help + Only one NTFS can be built into the kernel(y) when selecting a + specific default. Both can still be built as modules(m). + + config DEFAULT_NTFS_NONE + bool "No built-in restriction (allows both drivers as 'y')"as m?
Right.
Quoted 29 lines
Quoted 29 lines
fs/Kconfig +8
-0+ + config DEFAULT_NTFS + bool "NTFS" + + config DEFAULT_NTFS3 + bool "NTFS3" +endchoice + endmenu endif # BLOCKfs/Makefile +1
-0@@ -90,6 +90,7 @@ obj-$(CONFIG_NLS) += nls/ obj-y += unicode/ obj-$(CONFIG_SMBFS) += smb/ obj-$(CONFIG_HPFS_FS) += hpfs/ +obj-$(CONFIG_NTFS_FS) += ntfs/ obj-$(CONFIG_NTFS3_FS) += ntfs3/ obj-$(CONFIG_UFS_FS) += ufs/ obj-$(CONFIG_EFS_FS) += efs/fs/ntfs/Kconfig new file +0
-0
Quoted 8 lines
fs/ntfs/Kconfig line 4
Quoted 5 lines
fs/ntfs/Kconfig new file +4
-0@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only +config NTFS_FS + tristate "NTFS file system support" + depends on !DEFAULT_NTFS3 || mI am not seeing similar change to
fs/ntfs3/Kconfig
Yes, I am missing it. I will add it on v4.
Thanks for your review!
Quoted 73 lines
Thanks,
Amir.Quoted 69 lines
fs/ntfs/Kconfig new file +42
-0+ select NLS + help + NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003. + This allows you to mount devices formatted with the ntfs file system. + + To compile this as a module, choose M here: the module will be called + ntfs. + +config NTFS_DEBUG + bool "NTFS debugging support" + depends on NTFS_FS + help + If you are experiencing any problems with the NTFS file system, say + Y here. This will result in additional consistency checks to be + performed by the driver as well as additional debugging messages to + be written to the system log. Note that debugging messages are + disabled by default. To enable them, supply the option debug_msgs=1 + at the kernel command line when booting the kernel or as an option + to insmod when loading the ntfs module. Once the driver is active, + you can enable debugging messages by doing (as root): + echo 1 > /proc/sys/fs/ntfs-debug + Replacing the "1" with "0" would disable debug messages. + + If you leave debugging messages disabled, this results in little + overhead, but enabling debug messages results in very significant + slowdown of the system. + + When reporting bugs, please try to have available a full dump of + debugging messages while the misbehaviour was occurring. + +config NTFS_FS_POSIX_ACL + bool "NTFS POSIX Access Control Lists" + depends on NTFS_FS + select FS_POSIX_ACL + help + POSIX Access Control Lists (ACLs) support additional access rights + for users and groups beyond the standard owner/group/world scheme, + and this option selects support for ACLs specifically for ntfs + filesystems. + NOTE: this is linux only feature. Windows will ignore these ACLs. + + If you don't know what Access Control Lists are, say N.fs/ntfs/Makefile new file +18
-1@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the ntfs filesystem support. +# + +# to check robot warnings +ccflags-y += -Wint-to-pointer-cast \ + $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \ + $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration) + +obj-$(CONFIG_NTFS_FS) += ntfs.o + +ntfs-y := aops.o attrib.o collate.o dir.o file.o index.o inode.o \ + mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \ + upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \ + iomap.o debug.o sysctl.o quota.o + +ccflags-$(CONFIG_NTFS_DEBUG) += -DDEBUG --2.25.1
Re: [PATCH v3 13/14] ntfs: add Kconfig and Makefile
In reply to Namjae Jeonfs/ntfs/Makefile line 6
Quoted 8 lines · Namjae Jeon
+++ b/fs/ntfs/Makefile
fs/ntfs/Makefile new file +6
-0@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the ntfs filesystem support. +# + +# to check robot warnings
What does this comment mean? I see ntfs3 also has this, so was this a case of blindly copying?
fs/ntfs/Makefile line 9
Quoted 3 lines
fs/ntfs/Makefile new file +3
-0+ccflags-y += -Wint-to-pointer-cast \ + $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \ + $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)
-Wint-to-pointer-cast is already enabled by default, -Wunused-but-set-variable is enabled by -Wall, so both of these can be dropped I think.
Namjae Jeon
maintainerRe: [PATCH v3 13/14] ntfs: add Kconfig and Makefile
Quoted 13 lines · Matthew Wilcox
fs/ntfs/Makefile line 6
Quoted 8 lines · Namjae Jeon
+++ b/fs/ntfs/Makefile
fs/ntfs/Makefile new file +6
-0@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the ntfs filesystem support. +# + +# to check robot warningsWhat does this comment mean? I see ntfs3 also has this, so was this a case of blindly copying?
Yes, It is added while syncing with ntfs3. I'll remove it.
Quoted 8 lines
Quoted 4 lines
fs/ntfs/Makefile new file +3
-0+ccflags-y += -Wint-to-pointer-cast \ + $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \ + $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)(quoted diff) +0
-2-Wint-to-pointer-cast is already enabled by default, -Wunused-but-set-variable is enabled by -Wall, so both of these can bedropped I think.
Okay, I will remove it also.
Thanks for your review!
Quoted 1 line
Namjae Jeon
maintainerPATCH v3 14/14 MAINTAINERS: add ntfs filesystem
In reply to Namjae JeonAdd myself and Hyunchul Lee as ntfs maintainer.
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -18646,6 +18646,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 <[email protected]> +M: Hyunchul Lee <[email protected]> +L: [email protected] +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 <[email protected]> L: [email protected]
Signature · 1 line
2.25.1
Re: [PATCH v3 14/14] MAINTAINERS: add ntfs filesystem
Quoted 15 lines · Namjae Jeon
Add myself and Hyunchul Lee as ntfs maintainer.
Signed-off-by Namjae Jeon <[email protected]>--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)MAINTAINERS +0
-0@@ -18646,6 +18646,15 @@ W: https://github.com/davejiang/linux/wiki T: git https://github.com/davejiang/linux.git F: drivers/ntb/hw/intel/
MAINTAINERS W: https://github.com/davejiang/linux/wiki · line 18657
Quoted 10 lines
MAINTAINERS +9
-0+NTFS FILESYSTEM +M: Namjae Jeon <[email protected]> +M: Hyunchul Lee <[email protected]> +L: [email protected] +S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git +F: Documentation/filesystems/ntfs.rst +F: fs/ntfs/ +
Would have been nicer and more informative if you kept MAINTAINERS in the first revert patch and then really "Add yourself and Hyunchul Less as maintainers".
A note about the CREDITS file.
Willy's deprecate commit that you partially reverted added this CREDITS record:
`
NTFS FILESYSTEM
N: Anton Altaparmakov
E: [email protected]
D: NTFS filesystem
`
It is oddly formatted - this NTFS FILESYSTEM header is uncovetional in this file.
and also, Anton already had a more descriptive entry in the CREDITS file:
`
N: Anton Altaparmakov
E: [email protected]
W: http://www-stu.christs.cam.ac.uk/~aia21/
D: Author of new NTFS driver, various other kernel hacks.
S: Christ's College
S: Cambridge CB2 3BU
S: United Kingdom
`
So I think that the later entry could be reverted along with the revert commit and maybe add or update to the Tuxera email/website entries, because the current W link in CREDITS is broken.
Thanks,
Amir.
Namjae Jeon
maintainerRe: [PATCH v3 14/14] MAINTAINERS: add ntfs filesystem
Quoted 18 lines · Amir Goldstein
Quoted 16 lines · Namjae Jeon
Add myself and Hyunchul Lee as ntfs maintainer.
Signed-off-by Namjae Jeon <[email protected]>--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)MAINTAINERS +0
-0@@ -18646,6 +18646,15 @@ W: https://github.com/davejiang/linux/wiki T: git https://github.com/davejiang/linux.git F: drivers/ntb/hw/intel/
Quoted 13 lines
MAINTAINERS W: https://github.com/davejiang/linux/wiki · line 18657
Quoted 9 lines
MAINTAINERS +9
-0+NTFS FILESYSTEM +M: Namjae Jeon <[email protected]> +M: Hyunchul Lee <[email protected]> +L: [email protected] +S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git +F: Documentation/filesystems/ntfs.rst +F: fs/ntfs/ +Would have been nicer and more informative if you kept
MAINTAINERSin the first revert patch and then really "Add yourself and Hyunchul Less as maintainers".
Okay.
Quoted 10 lines
A note about the CREDITS file.
Willy's deprecate commit that you partially reverted added this CREDITS record:
`
NTFS FILESYSTEM
N: Anton Altaparmakov
E: [email protected]
D: NTFS filesystem
`
Quoted 3 lines
It is oddly formatted - this NTFS FILESYSTEM header is uncovetional in this file.
and also, Anton already had a more descriptive entry in the CREDITS file:
Right.
Quoted 10 lines
`
N: Anton Altaparmakov
E: [email protected]
W: http://www-stu.christs.cam.ac.uk/~aia21/
D: Author of new NTFS driver, various other kernel hacks.
S: Christ's College
S: Cambridge CB2 3BU
S: United Kingdom
`
Quoted 3 lines
So I think that the later entry could be reverted along with the revert commit and maybe add or update to the Tuxera email/website entries, because the current W link in CREDITS is broken.
Okay, I will update it on v4.
Thanks for your review!
Quoted 3 lines
Thanks,
Amir.
Quoted 116 lines · Namjae Jeon
Introduction
============The NTFS filesystem[1] still remains the default filesystem for Windows and The well-maintained NTFS driver in the Linux kernel enhances interoperability with Windows devices, making it easier for Linux users to work with NTFS-formatted drives. Currently, ntfs support in Linux was the long-neglected NTFS Classic (read-only), which has been removed from the Linux kernel, leaving the poorly maintained ntfs3. ntfs3 still has many problems and is poorly maintained, so users and distributions are still using the old legacy ntfs-3g.
The remade ntfs is an implementation that supports write and the essential
requirements(iomap, no buffer-head, utilities, xfstests test result)based on read-only classic NTFS.
The old read-only ntfs code is much cleaner, with extensive comments, offers readability that makes understanding NTFS easier. This is why new ntfs was developed on old read-only NTFS base.
The target is to provide currenttrends(iomap, no buffer head, folio), enhanced performance, stable maintenance, utility support including fsck.Key Features
============- Write support:
Implement write support on classic read-only NTFS. Additionally, integrate delayed allocation to enhance write performance through multi-cluster allocation and minimized fragmentation of cluster bitmap.- Switch to using iomap:
Use iomap for buffered IO writes, reads, direct IO, file extent mapping, readpages, writepages operations.- Stop using the buffer head:
The use of buffer head in old ntfs and switched to use folio instead. As a result,CONFIG_BUFFER_HEADoption enable is removed inKconfigalso.- Public utilities include fsck[2]:
While ntfs-3g includes ntfsprogs as a component, it notably lacks the fsck implementation. So we have launched a new ntfs utilitiies project called ntfsprogs-plus by forking from ntfs-3g after removing unnecessary ntfs fuse implementation. fsck.ntfs can be used for ntfs testing with xfstests as well as for recovering corrupted NTFS device.- Performance Enhancements:
- ntfs vs. ntfs3:
* Performance was benchmarked using iozone with various chunk size.
- In single-thread(1T) write tests, ntfs show approximately 3~5% better performance.
- In multi-thread(4T) write tests, ntfs show approximately 35~110% better performance.
- Read throughput is identical for both ntfs implementations.1GB file size:4096 size:16384 size:65536
MB/sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
read 399 | 399 426 | 424 429 | 430
─────────────────────────────────────────────────────────────────
write(1T) 291 | 276 325 | 305 333 | 317
write(4T) 105 | 50 113 | 78 114 | 99.6* File list browsing performance. (about 12~14% faster)
files:100000 files:200000 files:400000
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
ls -lR 7.07 | 8.10 14.03 | 16.35 28.27 | 32.86* mount time.
parti_size:1TB parti_size:2TB parti_size:4TB
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
mount 0.38 | 2.03 0.39 | 2.25 0.70 | 4.51The following are the reasons why ntfs performance is higher
compared to ntfs3:
- Use iomap aops.
- Delayed allocation support.
- Optimize zero out for newly allocated clusters.
- Optimize runlist merge overhead with small chunck size.
- pre-load mft(inode) blocks and index(dentry) blocks to improve readdir + stat performance.
- Load lcn bitmap on background.- Stability improvement:
a. Pass more xfstests tests:
ntfs passed 287 tests, significantly higher than ntfs3's 218. ntfs implement fallocate, idmapped mount and permission, etc, resulting in a significantly high number of xfstests passing compared to ntfs3.
b. Bonnie++ issue[3]:
The Bonnie++ benchmark fails on ntfs3 with a "Directory not empty" error during file deletion. ntfs3 currently iterates directory entries by reading index blocks one by one. When entries are deleted concurrently, index block merging or entry relocation can causereaddir()to skip some entries, leaving files undeleted in workloads(bonnie++) that mix unlink and directory scans. ntfs implement leaf chain traversal in readdir to avoid entry skip on deletion.- Journaling support:
ntfs3 does not provide full journaling support. It only implement journal replay[4], which in our testing did not function correctly. My next task after upstreaming will be to add full journal support to ntfs.The feature comparison summary
==============================
Quoted 12 lines
Feature ntfs ntfs3 =================================== ======== =========== Write support Yes Yes iomap support Yes No No buffer head Yes No Public utilities(mkfs, fsck, etc.) Yes No xfstests passed 287 218 Idmapped mount Yes No Delayed allocation Yes No Bonnie++ Pass Fail Journaling Planned Inoperative =================================== ======== ===========
For completion of this report, are the 287 passed xfstests a super set of the 218
passed xfstest for ntfs3?
IOW, are there any known functional regressions from ntfs3 to ntfs?
Thanks,
Amir.
Namjae Jeon
maintainerQuoted 131 lines · Amir Goldstein
Quoted 116 lines · Namjae Jeon
Introduction
============The NTFS filesystem[1] still remains the default filesystem for Windows and The well-maintained NTFS driver in the Linux kernel enhances interoperability with Windows devices, making it easier for Linux users to work with NTFS-formatted drives. Currently, ntfs support in Linux was the long-neglected NTFS Classic (read-only), which has been removed from the Linux kernel, leaving the poorly maintained ntfs3. ntfs3 still has many problems and is poorly maintained, so users and distributions are still using the old legacy ntfs-3g.
The remade ntfs is an implementation that supports write and the essential
requirements(iomap, no buffer-head, utilities, xfstests test result)based on read-only classic NTFS.
The old read-only ntfs code is much cleaner, with extensive comments, offers readability that makes understanding NTFS easier. This is why new ntfs was developed on old read-only NTFS base.
The target is to provide currenttrends(iomap, no buffer head, folio), enhanced performance, stable maintenance, utility support including fsck.Key Features
============- Write support:
Implement write support on classic read-only NTFS. Additionally, integrate delayed allocation to enhance write performance through multi-cluster allocation and minimized fragmentation of cluster bitmap.- Switch to using iomap:
Use iomap for buffered IO writes, reads, direct IO, file extent mapping, readpages, writepages operations.- Stop using the buffer head:
The use of buffer head in old ntfs and switched to use folio instead. As a result,CONFIG_BUFFER_HEADoption enable is removed inKconfigalso.- Public utilities include fsck[2]:
While ntfs-3g includes ntfsprogs as a component, it notably lacks the fsck implementation. So we have launched a new ntfs utilitiies project called ntfsprogs-plus by forking from ntfs-3g after removing unnecessary ntfs fuse implementation. fsck.ntfs can be used for ntfs testing with xfstests as well as for recovering corrupted NTFS device.- Performance Enhancements:
- ntfs vs. ntfs3:
* Performance was benchmarked using iozone with various chunk size.
- In single-thread(1T) write tests, ntfs show approximately 3~5% better performance.
- In multi-thread(4T) write tests, ntfs show approximately 35~110% better performance.
- Read throughput is identical for both ntfs implementations.1GB file size:4096 size:16384 size:65536
MB/sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
read 399 | 399 426 | 424 429 | 430
─────────────────────────────────────────────────────────────────
write(1T) 291 | 276 325 | 305 333 | 317
write(4T) 105 | 50 113 | 78 114 | 99.6* File list browsing performance. (about 12~14% faster)
files:100000 files:200000 files:400000
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
ls -lR 7.07 | 8.10 14.03 | 16.35 28.27 | 32.86* mount time.
parti_size:1TB parti_size:2TB parti_size:4TB
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
mount 0.38 | 2.03 0.39 | 2.25 0.70 | 4.51The following are the reasons why ntfs performance is higher
compared to ntfs3:
- Use iomap aops.
- Delayed allocation support.
- Optimize zero out for newly allocated clusters.
- Optimize runlist merge overhead with small chunck size.
- pre-load mft(inode) blocks and index(dentry) blocks to improve readdir + stat performance.
- Load lcn bitmap on background.- Stability improvement:
a. Pass more xfstests tests:
ntfs passed 287 tests, significantly higher than ntfs3's 218. ntfs implement fallocate, idmapped mount and permission, etc, resulting in a significantly high number of xfstests passing compared to ntfs3.
b. Bonnie++ issue[3]:
The Bonnie++ benchmark fails on ntfs3 with a "Directory not empty" error during file deletion. ntfs3 currently iterates directory entries by reading index blocks one by one. When entries are deleted concurrently, index block merging or entry relocation can causereaddir()to skip some entries, leaving files undeleted in workloads(bonnie++) that mix unlink and directory scans. ntfs implement leaf chain traversal in readdir to avoid entry skip on deletion.- Journaling support:
ntfs3 does not provide full journaling support. It only implement journal replay[4], which in our testing did not function correctly. My next task after upstreaming will be to add full journal support to ntfs.The feature comparison summary
==============================Quoted 12 lines
Feature ntfs ntfs3 =================================== ======== =========== Write support Yes Yes iomap support Yes No No buffer head Yes No Public utilities(mkfs, fsck, etc.) Yes No xfstests passed 287 218 Idmapped mount Yes No Delayed allocation Yes No Bonnie++ Pass Fail Journaling Planned Inoperative =================================== ======== ===========
Quoted 4 lines
For completion of this report, are the 287 passed xfstests a super set of the 218
passed xfstest for ntfs3?
IOW, are there any known functional regressions from ntfs3 to ntfs?
There are 9 testcases that passed in ntfs3 but fail in ntfs. I will fix them on v4.
Thanks!
Quoted 3 lines
Thanks,
Amir.
Quoted 138 lines · Namjae Jeon
Introduction
============The NTFS filesystem[1] still remains the default filesystem for Windows and The well-maintained NTFS driver in the Linux kernel enhances interoperability with Windows devices, making it easier for Linux users to work with NTFS-formatted drives. Currently, ntfs support in Linux was the long-neglected NTFS Classic (read-only), which has been removed from the Linux kernel, leaving the poorly maintained ntfs3. ntfs3 still has many problems and is poorly maintained, so users and distributions are still using the old legacy ntfs-3g.
The remade ntfs is an implementation that supports write and the essential
requirements(iomap, no buffer-head, utilities, xfstests test result)based on read-only classic NTFS.
The old read-only ntfs code is much cleaner, with extensive comments, offers readability that makes understanding NTFS easier. This is why new ntfs was developed on old read-only NTFS base.
The target is to provide currenttrends(iomap, no buffer head, folio), enhanced performance, stable maintenance, utility support including fsck.Key Features
============- Write support:
Implement write support on classic read-only NTFS. Additionally, integrate delayed allocation to enhance write performance through multi-cluster allocation and minimized fragmentation of cluster bitmap.- Switch to using iomap:
Use iomap for buffered IO writes, reads, direct IO, file extent mapping, readpages, writepages operations.- Stop using the buffer head:
The use of buffer head in old ntfs and switched to use folio instead. As a result,CONFIG_BUFFER_HEADoption enable is removed inKconfigalso.- Public utilities include fsck[2]:
While ntfs-3g includes ntfsprogs as a component, it notably lacks the fsck implementation. So we have launched a new ntfs utilitiies project called ntfsprogs-plus by forking from ntfs-3g after removing unnecessary ntfs fuse implementation. fsck.ntfs can be used for ntfs testing with xfstests as well as for recovering corrupted NTFS device.- Performance Enhancements:
- ntfs vs. ntfs3:
* Performance was benchmarked using iozone with various chunk size.
- In single-thread(1T) write tests, ntfs show approximately 3~5% better performance.
- In multi-thread(4T) write tests, ntfs show approximately 35~110% better performance.
- Read throughput is identical for both ntfs implementations.1GB file size:4096 size:16384 size:65536
MB/sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
read 399 | 399 426 | 424 429 | 430
─────────────────────────────────────────────────────────────────
write(1T) 291 | 276 325 | 305 333 | 317
write(4T) 105 | 50 113 | 78 114 | 99.6* File list browsing performance. (about 12~14% faster)
files:100000 files:200000 files:400000
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
ls -lR 7.07 | 8.10 14.03 | 16.35 28.27 | 32.86* mount time.
parti_size:1TB parti_size:2TB parti_size:4TB
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
mount 0.38 | 2.03 0.39 | 2.25 0.70 | 4.51The following are the reasons why ntfs performance is higher
compared to ntfs3:
- Use iomap aops.
- Delayed allocation support.
- Optimize zero out for newly allocated clusters.
- Optimize runlist merge overhead with small chunck size.
- pre-load mft(inode) blocks and index(dentry) blocks to improve readdir + stat performance.
- Load lcn bitmap on background.- Stability improvement:
a. Pass more xfstests tests:
ntfs passed 287 tests, significantly higher than ntfs3's 218. ntfs implement fallocate, idmapped mount and permission, etc, resulting in a significantly high number of xfstests passing compared to ntfs3.
b. Bonnie++ issue[3]:
The Bonnie++ benchmark fails on ntfs3 with a "Directory not empty" error during file deletion. ntfs3 currently iterates directory entries by reading index blocks one by one. When entries are deleted concurrently, index block merging or entry relocation can causereaddir()to skip some entries, leaving files undeleted in workloads(bonnie++) that mix unlink and directory scans. ntfs implement leaf chain traversal in readdir to avoid entry skip on deletion.- Journaling support:
ntfs3 does not provide full journaling support. It only implement journal replay[4], which in our testing did not function correctly. My next task after upstreaming will be to add full journal support to ntfs.The feature comparison summary
==============================Feature ntfs ntfs3 =================================== ======== =========== Write support Yes Yes iomap support Yes No No buffer head Yes No Public utilities(mkfs, fsck, etc.) Yes No xfstests passed 287 218 Idmapped mount Yes No Delayed allocation Yes No Bonnie++ Pass Fail Journaling Planned Inoperative =================================== ======== ===========References
==========
[1] https://en.wikipedia.org/wiki/NTFS
[2] https://github.com/ntfsprogs-plus/ntfsprogs-plus
[3] https://lore.kernel.org/ntfs3/CAOZgwEd7NDkGEpdF6UQTcbYuupDavaHBoj4WwTy3Qe4Bqm6V0g@mail.gmail.com/
[4] https://marc.info/?l=linux-fsdevel&m=161738417018673&q=mbox
Quoted 4 lines
Available in the Git repository at:
===================================git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.gitntfs-next
Thanks for renaming this to ntfs. :)
That said, are you able to make a commitment about journaling support work? I vaguely recall that a similar promise was made with ntfs3 and, well... here we are.
I would have preferred to see it as part of the initial upstreaming, but I'm equally fine with some kind of known timeline post merge for working on it.
Thanks for this great work!
Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Namjae Jeon
maintainerQuoted 145 lines · Neal Gompa
Quoted 138 lines · Namjae Jeon
Introduction
============The NTFS filesystem[1] still remains the default filesystem for Windows and The well-maintained NTFS driver in the Linux kernel enhances interoperability with Windows devices, making it easier for Linux users to work with NTFS-formatted drives. Currently, ntfs support in Linux was the long-neglected NTFS Classic (read-only), which has been removed from the Linux kernel, leaving the poorly maintained ntfs3. ntfs3 still has many problems and is poorly maintained, so users and distributions are still using the old legacy ntfs-3g.
The remade ntfs is an implementation that supports write and the essential
requirements(iomap, no buffer-head, utilities, xfstests test result)based on read-only classic NTFS.
The old read-only ntfs code is much cleaner, with extensive comments, offers readability that makes understanding NTFS easier. This is why new ntfs was developed on old read-only NTFS base.
The target is to provide currenttrends(iomap, no buffer head, folio), enhanced performance, stable maintenance, utility support including fsck.Key Features
============- Write support:
Implement write support on classic read-only NTFS. Additionally, integrate delayed allocation to enhance write performance through multi-cluster allocation and minimized fragmentation of cluster bitmap.- Switch to using iomap:
Use iomap for buffered IO writes, reads, direct IO, file extent mapping, readpages, writepages operations.- Stop using the buffer head:
The use of buffer head in old ntfs and switched to use folio instead. As a result,CONFIG_BUFFER_HEADoption enable is removed inKconfigalso.- Public utilities include fsck[2]:
While ntfs-3g includes ntfsprogs as a component, it notably lacks the fsck implementation. So we have launched a new ntfs utilitiies project called ntfsprogs-plus by forking from ntfs-3g after removing unnecessary ntfs fuse implementation. fsck.ntfs can be used for ntfs testing with xfstests as well as for recovering corrupted NTFS device.- Performance Enhancements:
- ntfs vs. ntfs3:
* Performance was benchmarked using iozone with various chunk size.
- In single-thread(1T) write tests, ntfs show approximately 3~5% better performance.
- In multi-thread(4T) write tests, ntfs show approximately 35~110% better performance.
- Read throughput is identical for both ntfs implementations.1GB file size:4096 size:16384 size:65536
MB/sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
read 399 | 399 426 | 424 429 | 430
─────────────────────────────────────────────────────────────────
write(1T) 291 | 276 325 | 305 333 | 317
write(4T) 105 | 50 113 | 78 114 | 99.6* File list browsing performance. (about 12~14% faster)
files:100000 files:200000 files:400000
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
ls -lR 7.07 | 8.10 14.03 | 16.35 28.27 | 32.86* mount time.
parti_size:1TB parti_size:2TB parti_size:4TB
Sec ntfs | ntfs3 ntfs | ntfs3 ntfs | ntfs3
─────────────────────────────────────────────────────────────────
mount 0.38 | 2.03 0.39 | 2.25 0.70 | 4.51The following are the reasons why ntfs performance is higher
compared to ntfs3:
- Use iomap aops.
- Delayed allocation support.
- Optimize zero out for newly allocated clusters.
- Optimize runlist merge overhead with small chunck size.
- pre-load mft(inode) blocks and index(dentry) blocks to improve readdir + stat performance.
- Load lcn bitmap on background.- Stability improvement:
a. Pass more xfstests tests:
ntfs passed 287 tests, significantly higher than ntfs3's 218. ntfs implement fallocate, idmapped mount and permission, etc, resulting in a significantly high number of xfstests passing compared to ntfs3.
b. Bonnie++ issue[3]:
The Bonnie++ benchmark fails on ntfs3 with a "Directory not empty" error during file deletion. ntfs3 currently iterates directory entries by reading index blocks one by one. When entries are deleted concurrently, index block merging or entry relocation can causereaddir()to skip some entries, leaving files undeleted in workloads(bonnie++) that mix unlink and directory scans. ntfs implement leaf chain traversal in readdir to avoid entry skip on deletion.- Journaling support:
ntfs3 does not provide full journaling support. It only implement journal replay[4], which in our testing did not function correctly. My next task after upstreaming will be to add full journal support to ntfs.The feature comparison summary
==============================Feature ntfs ntfs3 =================================== ======== =========== Write support Yes Yes iomap support Yes No No buffer head Yes No Public utilities(mkfs, fsck, etc.) Yes No xfstests passed 287 218 Idmapped mount Yes No Delayed allocation Yes No Bonnie++ Pass Fail Journaling Planned Inoperative =================================== ======== ===========References
==========
[1] https://en.wikipedia.org/wiki/NTFS
[2] https://github.com/ntfsprogs-plus/ntfsprogs-plus
[3] https://lore.kernel.org/ntfs3/CAOZgwEd7NDkGEpdF6UQTcbYuupDavaHBoj4WwTy3Qe4Bqm6V0g@mail.gmail.com/
[4] https://marc.info/?l=linux-fsdevel&m=161738417018673&q=mboxQuoted 4 lines
Available in the Git repository at:
===================================git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.gitntfs-next
Quoted 4 lines
Thanks for renaming this to ntfs. :)
That said, are you able to make a commitment about journaling support work?
some people asked the same question, I said I would start that work as soon as this upstream is finished.
Quoted 2 lines
I vaguely recall that a similar promise was made with ntfs3 and, well... here we are.
I expected it would end up like this after all. But this time, it will be different. In a similar case, when I upstreamed exfat filesystem, Eric requested public utilities. After upstreaming exfat, we developed and released exfatprogs, which included mkfs, fsck, dump, etc, and currently, well-known CE vendors have adopted linux exfat driver and exfatprogs for their products. I will maintain the new ntfs in the same way.
Quoted 10 lines
I would have preferred to see it as part of the initial upstreaming, but I'm equally fine with some kind of known timeline post merge for working on it.
Thanks for this great work!
--
真実はいつも一つ!/ Always, there's only one truth!