Skip to contentSkip to conversation

xfs: fix calculation of freed inode cluster blocks

RFC PATCH Superseded Ben Myers 2 participants 2 messages Dec 3, 2013 XFS filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ben Myers

author
#0 lore raw

RFC PATCH 1/1 xfs: fix calculation of freed inode cluster blocks

rec.ir_startino is an agino rather than an ino. Use the correct macro when dealing with it in xfs_difree.

---

This is very lightly tested so it's RFC. Looks like using "ino to agbno" is actually harmless when you pass in an agino, so there shouldn't have been any trouble caused by this one.

-Ben

 fs/xfs/xfs_ialloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_ialloc.c +1 -1
Index: b/fs/xfs/xfs_ialloc.c
===================================================================
@@ -1229,7 +1229,7 @@ xfs_difree(
 		}
 
 		xfs_bmap_add_free(XFS_AGB_TO_FSB(mp,
-				agno, XFS_INO_TO_AGBNO(mp,rec.ir_startino)),
+				agno, XFS_AGINO_TO_AGBNO(mp, rec.ir_startino)),
 				XFS_IALLOC_BLOCKS(mp), flist, mp);
 	} else {
 		*delete = 0;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 8 lines · Ben Myers

rec.ir_startino is an agino rather than an ino. Use the correct macro when dealing with it in xfs_difree.

---

This is very lightly tested so it's RFC. Looks like using "ino to agbno" is actually harmless when you pass in an agino, so there shouldn't have been any trouble caused by this one.

Right, the XFS_INO_TO_AGBNO() macro will behave correctly when passed an agino - it's the same as an inode from AG 0. Changing the macro to the correct one is effectively a no-op, so just send a patch and get it reviewed and integrated...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs