* [PATCH] nilfs2: remove two dead '#if 0' blocks
@ 2026-10-22 22:06 Breno Rodrigues Alves
2026-10-23 1:13 ` Ryusuke Konishi
0 siblings, 1 reply; 3+ messages in thread
From: Breno Rodrigues Alves @ 2026-10-22 22:06 UTC (permalink / raw)
To: Ryusuke Konishi
Cc: Viacheslav Dubeyko, linux-nilfs, linux-kernel, Breno Rodrigues Alves
Remove two blocks of code that have been disabled with '#if 0' since
the initial nilfs2 import:
- inode.c: the code that would have read i_file_acl and i_dir_acl
from the on-disk inode. nilfs2 has never implemented ACLs, and
the i_file_acl/i_dir_acl fields do not exist in struct
nilfs_inode_info, so this block has never been compiled.
- super.c: the classic ext2 "maximal mount count reached" check.
nilfs2 reads and rewrites s_max_mnt_count for on-disk
compatibility, but the check itself was never enabled. Removing
the disabled branch does not change the on-disk format or the
behaviour of the driver.
No functional changes.
Signed-off-by: Breno Rodrigues Alves <breno3011alves@gmail.com>
---
fs/nilfs2/inode.c | 5 -----
fs/nilfs2/super.c | 4 ----
2 files changed, 9 deletions(-)
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 34e609606..c5b0e9f27 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -422,11 +422,6 @@ int nilfs_read_inode_common(struct inode *inode,
inode->i_blocks = le64_to_cpu(raw_inode->i_blocks);
ii->i_flags = le32_to_cpu(raw_inode->i_flags);
-#if 0
- ii->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
- ii->i_dir_acl = S_ISREG(inode->i_mode) ?
- 0 : le32_to_cpu(raw_inode->i_dir_acl);
-#endif
ii->i_dir_start_lookup = 0;
inode->i_generation = le32_to_cpu(raw_inode->i_generation);
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 893a504cb..d0faae49c 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -826,10 +826,6 @@ static int nilfs_setup_super(struct super_block *sb, int is_mount)
if (nilfs->ns_mount_state & NILFS_ERROR_FS) {
nilfs_warn(sb, "mounting fs with errors");
-#if 0
- } else if (max_mnt_count >= 0 && mnt_count >= max_mnt_count) {
- nilfs_warn(sb, "maximal mount count reached");
-#endif
}
if (!max_mnt_count)
sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT);
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] nilfs2: remove two dead '#if 0' blocks
2026-10-22 22:06 [PATCH] nilfs2: remove two dead '#if 0' blocks Breno Rodrigues Alves
@ 2026-10-23 1:13 ` Ryusuke Konishi
2026-10-23 8:51 ` Breno Rodrigues Alves
0 siblings, 1 reply; 3+ messages in thread
From: Ryusuke Konishi @ 2026-10-23 1:13 UTC (permalink / raw)
To: Breno Rodrigues Alves; +Cc: Viacheslav Dubeyko, linux-nilfs, linux-kernel
On Fri, Oct 23, 2026 at 7:06 AM Breno Rodrigues Alves wrote:
>
> Remove two blocks of code that have been disabled with '#if 0' since
> the initial nilfs2 import:
>
> - inode.c: the code that would have read i_file_acl and i_dir_acl
> from the on-disk inode. nilfs2 has never implemented ACLs, and
> the i_file_acl/i_dir_acl fields do not exist in struct
> nilfs_inode_info, so this block has never been compiled.
>
> - super.c: the classic ext2 "maximal mount count reached" check.
> nilfs2 reads and rewrites s_max_mnt_count for on-disk
> compatibility, but the check itself was never enabled. Removing
> the disabled branch does not change the on-disk format or the
> behaviour of the driver.
>
> No functional changes.
>
> Signed-off-by: Breno Rodrigues Alves <breno3011alves@gmail.com>
> ---
Hi Breno,
The same patch proposal was previously made and the changes have already
been merged into mainline in the current merge window:
https://lore.kernel.org/all/20260907-nilfs2-dead-code-cleanup-v2-1-fa1ab5b0abd6@gmail.com/
Before submitting a patch, please make sure to check the latest mainline
master branch, the linux-next tree, and mailing list history.
Thanks,
Ryusuke Konishi
> fs/nilfs2/inode.c | 5 -----
> fs/nilfs2/super.c | 4 ----
> 2 files changed, 9 deletions(-)
>
> diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
> index 34e609606..c5b0e9f27 100644
> --- a/fs/nilfs2/inode.c
> +++ b/fs/nilfs2/inode.c
> @@ -422,11 +422,6 @@ int nilfs_read_inode_common(struct inode *inode,
>
> inode->i_blocks = le64_to_cpu(raw_inode->i_blocks);
> ii->i_flags = le32_to_cpu(raw_inode->i_flags);
> -#if 0
> - ii->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
> - ii->i_dir_acl = S_ISREG(inode->i_mode) ?
> - 0 : le32_to_cpu(raw_inode->i_dir_acl);
> -#endif
> ii->i_dir_start_lookup = 0;
> inode->i_generation = le32_to_cpu(raw_inode->i_generation);
>
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index 893a504cb..d0faae49c 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -826,10 +826,6 @@ static int nilfs_setup_super(struct super_block *sb, int is_mount)
>
> if (nilfs->ns_mount_state & NILFS_ERROR_FS) {
> nilfs_warn(sb, "mounting fs with errors");
> -#if 0
> - } else if (max_mnt_count >= 0 && mnt_count >= max_mnt_count) {
> - nilfs_warn(sb, "maximal mount count reached");
> -#endif
> }
> if (!max_mnt_count)
> sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT);
> --
> 2.56.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] nilfs2: remove two dead '#if 0' blocks
2026-10-23 1:13 ` Ryusuke Konishi
@ 2026-10-23 8:51 ` Breno Rodrigues Alves
0 siblings, 0 replies; 3+ messages in thread
From: Breno Rodrigues Alves @ 2026-10-23 8:51 UTC (permalink / raw)
To: Ryusuke Konishi
Cc: Viacheslav Dubeyko, linux-nilfs, linux-kernel, Breno Rodrigues Alves
Hi Ryusuke,
Thank you for the pointer - I should have checked the latest mainline
master and the linux-nilfs list history before sending. Please consider
the patch dropped.
I will be more careful next time.
Breno
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-23 8:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 22:06 [PATCH] nilfs2: remove two dead '#if 0' blocks Breno Rodrigues Alves
2026-10-23 1:13 ` Ryusuke Konishi
2026-10-23 8:51 ` Breno Rodrigues Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®