* Re: 4K inode support on 4Kn device
2026-04-21 1:42 4K inode support on 4Kn device Wang Yugui
@ 2026-04-21 5:48 ` Carlos Maiolino
2026-04-21 23:01 ` [PATCH] xfsprogs: 4K inode support Wang Yugui
2026-04-21 23:05 ` [ RFC ] xfs: " Wang Yugui
2 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2026-04-21 5:48 UTC (permalink / raw)
To: Wang Yugui; +Cc: linux-xfs
On Tue, Apr 21, 2026 at 09:42:05AM +0800, Wang Yugui wrote:
> Hi,
>
> I want to support 4K inode on 4Kn device.
>
> 1, change the size of XFS_DINODE_MAX_SIZE/XFS_DINODE_MAX_LOG
> to 4096/12 from 2048/11.
>
> 2, do we need to keep the following restriction in man mkfs.xfs?
> the inode size cannot exceed one half of the filesystem block size.
Can you please better detail what are you trying to achieve with 4KiB
inodes?
>
> Best Regards
> Wang Yugui (wangyugui@e16-tech.com)
> 2026/04/21
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] xfsprogs: 4K inode support
2026-04-21 1:42 4K inode support on 4Kn device Wang Yugui
2026-04-21 5:48 ` Carlos Maiolino
@ 2026-04-21 23:01 ` Wang Yugui
2026-04-21 23:05 ` [ RFC ] xfs: " Wang Yugui
2 siblings, 0 replies; 4+ messages in thread
From: Wang Yugui @ 2026-04-21 23:01 UTC (permalink / raw)
To: linux-xfs; +Cc: Wang Yugui
---
include/xfs_multidisk.h | 2 +-
libxfs/xfs_format.h | 2 +-
libxfs/xfs_sb.c | 1 +
man/man8/mkfs.xfs.8.in | 3 +--
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/xfs_multidisk.h b/include/xfs_multidisk.h
index ef4443b0bb0e..b77a915811f9 100644
--- a/include/xfs_multidisk.h
+++ b/include/xfs_multidisk.h
@@ -14,7 +14,7 @@
#define XFS_DFL_BLOCKSIZE_LOG 12 /* 4096 byte blocks */
#define XFS_DINODE_DFL_LOG 8 /* 256 byte inodes */
#define XFS_DINODE_DFL_CRC_LOG 9 /* 512 byte inodes for CRCs */
-#define XFS_MIN_INODE_PERBLOCK 2 /* min inodes per block */
+#define XFS_MIN_INODE_PERBLOCK 1 /* min inodes per block */
#define XFS_DFL_IMAXIMUM_PCT 25 /* max % of space for inodes */
#define XFS_MIN_REC_DIRSIZE 12 /* 4096 byte dirblocks (V2) */
#define XFS_MAX_INODE_SIG_BITS 32 /* most significant bits in an
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 779dac59b1f3..84cce8d268e6 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -1079,7 +1079,7 @@ enum xfs_dinode_fmt {
* Inode minimum and maximum sizes.
*/
#define XFS_DINODE_MIN_LOG 8
-#define XFS_DINODE_MAX_LOG 11
+#define XFS_DINODE_MAX_LOG 12
#define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG)
#define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG)
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index dd14c3ab3b59..9c57d13e50bc 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -717,6 +717,7 @@ xfs_validate_sb_common(
case 512:
case 1024:
case 2048:
+ case 4096:
break;
default:
xfs_warn(mp, "inode size of %d bytes not supported",
diff --git a/man/man8/mkfs.xfs.8.in b/man/man8/mkfs.xfs.8.in
index fbafc5c79e02..b0a2222d370d 100644
--- a/man/man8/mkfs.xfs.8.in
+++ b/man/man8/mkfs.xfs.8.in
@@ -638,8 +638,7 @@ The minimum (and default)
is 256 bytes without crc, 512 bytes with crc enabled.
The maximum
.I value
-is 2048 (2 KiB) subject to the restriction that
-the inode size cannot exceed one half of the filesystem block size.
+is 4096 (4 KiB).
.IP
XFS uses 64-bit inode numbers internally; however, the number of
significant bits in an inode number
--
2.36.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [ RFC ] xfs: 4K inode support
2026-04-21 1:42 4K inode support on 4Kn device Wang Yugui
2026-04-21 5:48 ` Carlos Maiolino
2026-04-21 23:01 ` [PATCH] xfsprogs: 4K inode support Wang Yugui
@ 2026-04-21 23:05 ` Wang Yugui
2 siblings, 0 replies; 4+ messages in thread
From: Wang Yugui @ 2026-04-21 23:05 UTC (permalink / raw)
To: linux-xfs; +Cc: Wang Yugui
use case for 4K inode
- simpler logic for 4Kn device, and less lock.
- better performance for directory with many files.
- maybe inline data support later.
TODO:
still crash in xfs_trans_read_buf_map() when mount a 4K inode xfs now.
---
fs/xfs/libxfs/xfs_format.h | 2 +-
fs/xfs/libxfs/xfs_metafile.c | 2 +-
fs/xfs/libxfs/xfs_sb.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 779dac59b1f3..84cce8d268e6 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -1079,7 +1079,7 @@ enum xfs_dinode_fmt {
* Inode minimum and maximum sizes.
*/
#define XFS_DINODE_MIN_LOG 8
-#define XFS_DINODE_MAX_LOG 11
+#define XFS_DINODE_MAX_LOG 12
#define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG)
#define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG)
diff --git a/fs/xfs/libxfs/xfs_metafile.c b/fs/xfs/libxfs/xfs_metafile.c
index cf239f862212..9db799576775 100644
--- a/fs/xfs/libxfs/xfs_metafile.c
+++ b/fs/xfs/libxfs/xfs_metafile.c
@@ -98,7 +98,7 @@ xfs_metafile_resv_can_cover(
* isn't critical unless there also isn't enough free space.
*/
return xfs_compare_freecounter(mp, XC_FREE_BLOCKS,
- rhs - mp->m_metafile_resv_avail, 2048) >= 0;
+ rhs - mp->m_metafile_resv_avail, 4096) >= 0;
}
/*
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 38d16fe1f6d8..39424a7c74df 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -734,6 +734,7 @@ xfs_validate_sb_common(
case 512:
case 1024:
case 2048:
+ case 4096:
break;
default:
xfs_warn(mp, "inode size of %d bytes not supported",
--
2.36.2
^ permalink raw reply related [flat|nested] 4+ messages in thread