Thread (26 messages) 26 messages, 3 authors, 2021-03-23

Re: [PATCH v8 2/5] xfs: hoist out xfs_resizefs_init_new_ags()

From: Brian Foster <hidden>
Date: 2021-03-22 12:22:24

On Mon, Mar 22, 2021 at 07:53:49PM +0800, Gao Xiang wrote:
On Mon, Mar 22, 2021 at 07:28:07AM -0400, Brian Foster wrote:
quoted
On Fri, Mar 05, 2021 at 10:57:00AM +0800, Gao Xiang wrote:
quoted
Move out related logic for initializing new added AGs to a new helper
in preparation for shrinking. No logic changes.

Reviewed-by: Darrick J. Wong <redacted>
Signed-off-by: Gao Xiang <redacted>
---
 fs/xfs/xfs_fsops.c | 107 +++++++++++++++++++++++++++------------------
 1 file changed, 64 insertions(+), 43 deletions(-)
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 9f9ba8bd0213..fc9e799b2ae3 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
...
quoted
quoted
@@ -123,9 +145,8 @@ xfs_growfs_data_private(
 	 */
 	if (nagcount > oagcount)
 		xfs_trans_mod_sb(tp, XFS_TRANS_SB_AGCOUNT, nagcount - oagcount);
-	if (nb > mp->m_sb.sb_dblocks)
-		xfs_trans_mod_sb(tp, XFS_TRANS_SB_DBLOCKS,
-				 nb - mp->m_sb.sb_dblocks);
+	if (delta > 0)
+		xfs_trans_mod_sb(tp, XFS_TRANS_SB_DBLOCKS, delta);
Hm.. isn't delta still unsigned as of this patch?
Not sure if some difference exists, I could update it as "if (delta)",
therefore it seems [PATCH v8 4/5] won't modify this anymore.
Yeah, not sure it's a problem, it just stands out a bit with it being in
a separate patch from the change to the variable type.

Brian
Thanks,
Gao Xiang
quoted
Brian
quoted
 	if (id.nfree)
 		xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, id.nfree);
 
@@ -152,7 +173,7 @@ xfs_growfs_data_private(
 	 * If we expanded the last AG, free the per-AG reservation
 	 * so we can reinitialize it with the new size.
 	 */
-	if (delta) {
+	if (lastag_resetagres) {
 		struct xfs_perag	*pag;
 
 		pag = xfs_perag_get(mp, id.agno);
-- 
2.27.0
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help