xfs_repair: set args.geo in dir2_kill_block
PATCH 1/1 xfs_repair: set args.geo in dir2_kill_block
This path in xfs_repair:
dir2_kill_block
libxfs_da_shrink_inode xfs_dir2_shrink_inode xfs_dir2_db_to_da
segfaults, because dir2_kill_block() does not initialize args.geo, and a null geometry winds up in xfs_dir2_db_to_da(), which dereferences it.
Fix that.
---
repair/phase6.c +1 -0
@@ -1438,6 +1438,7 @@ dir2_kill_block( args.firstblock = &firstblock; args.flist = &flist; args.whichfork =XFS_DATA_FORK ; + args.geo = mp->m_dir_geo;if (da_bno >= mp->m_dir_geo->leafblk && da_bno < mp->m_dir_geo->freeblk) error = -libxfs_da_shrink_inode (&args, da_bno, bp);else
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Looks good,
And I have to say the API where we need to initialize this non-obvious pointer in the da_args structure rally sucks :(
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Dave, ping on this?
Thanks,
-Eric
Quoted 29 lines · Eric Sandeen
This path in
xfs_repair:
dir2_kill_blocklibxfs_da_shrink_inode xfs_dir2_shrink_inode xfs_dir2_db_to_dasegfaults, because
dir2_kill_block()does not initialize args.geo, and a null geometry winds up inxfs_dir2_db_to_da(), which dereferences it.Fix that.
Signed-off-by Eric Sandeen <[email protected]>---
repair/phase6.c +1
-0@@ -1438,6 +1438,7 @@ dir2_kill_block( args.firstblock = &firstblock; args.flist = &flist; args.whichfork =XFS_DATA_FORK ; + args.geo = mp->m_dir_geo;if (da_bno >= mp->m_dir_geo->leafblk && da_bno < mp->m_dir_geo->freeblk) error = -libxfs_da_shrink_inode (&args, da_bno, bp);else
Quoted 5 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs