diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 1d934923e52ac7aa217c804b3330c5a726a5b86b..0a87378bcf437caa7fef60a4e18284cad9cfe4be 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -72,7 +72,7 @@ xfs_growfs_data_private( error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); if (error) - return error; + goto destroy_perag; /* * Write new AG headers to disk. Non-transactional, but need to be @@ -163,6 +163,9 @@ xfs_growfs_data_private( out_trans_cancel: xfs_trans_cancel(tp); +destroy_perag: + if (nagcount > oagcount) + xfs_destroy_perag(mp, oagcount, nagcount); return error; } diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index a4bdf24a070c38f3c7c7e985cecd43a837073d90..21547ff97b5a6782fae4c06f1b2fdec74acf2748 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -564,6 +564,8 @@ extern void xfs_uuid_table_free(void); extern int xfs_log_sbcount(xfs_mount_t *); extern uint64_t xfs_default_resblks(xfs_mount_t *mp); extern int xfs_mountfs(xfs_mount_t *mp); +extern void xfs_destroy_perag(xfs_mount_t *mp, xfs_agnumber_t agstart, + xfs_agnumber_t agend); extern int xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount, xfs_agnumber_t *maxagi); extern void xfs_unmountfs(xfs_mount_t *);