lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241104014439.3786609-3-zhangshida@kylinos.cn>
Date: Mon,  4 Nov 2024 09:44:36 +0800
From: zhangshida <starzhangzsd@...il.com>
To: djwong@...nel.org,
	dchinner@...hat.com,
	leo.lilong@...wei.com,
	wozizhi@...wei.com,
	osandov@...com,
	xiang@...nel.org,
	zhangjiachen.jaycee@...edance.com
Cc: linux-xfs@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	zhangshida@...inos.cn,
	starzhangzsd@...il.com
Subject: [PATCH 2/5] xfs: add two mp member to record the alloction field layout

From: Shida Zhang <zhangshida@...inos.cn>

Add two member to support the AF(alloction field) for each *mp*,
which means now we can have 3 AFs at most:
    [ 0, AF[0] )
    [ AF[0], AF[1] )
    [ AF[1], m_sb.agcount )

where AF[N],
    start agno of the AF[N] = mp->m_sb.agcount - mp->m_af[N]

On default,
    [ 0,  m_sb.agcount)
    [ m_sb.agcount, m_sb.agcount )
    [ m_sb.agcount, m_sb.agcount )

That means the entire filesystem can be deemed as a AF 0 extending
from 0 to m_sb.agcount.

Signed-off-by: Shida Zhang <zhangshida@...inos.cn>
---
 fs/xfs/xfs_mount.h | 3 +++
 fs/xfs/xfs_super.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 96496f39f551..38dff08b467d 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -260,6 +260,9 @@ typedef struct xfs_mount {
 
 	/* Hook to feed dirent updates to an active online repair. */
 	struct xfs_hooks	m_dir_update_hooks;
+
+	/* Relative start agno of the AFs */
+	xfs_agnumber_t		m_af[2];
 } xfs_mount_t;
 
 #define M_IGEO(mp)		(&(mp)->m_ino_geo)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index fbb3a1594c0d..0975ad55557e 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -2040,6 +2040,8 @@ static int xfs_init_fs_context(
 	mp->m_logbufs = -1;
 	mp->m_logbsize = -1;
 	mp->m_allocsize_log = 16; /* 64k */
+	mp->m_af[0] = 0;
+	mp->m_af[1] = 0;
 
 	xfs_hooks_init(&mp->m_dir_update_hooks);
 
-- 
2.33.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ