diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index e81e052dcb7502bef54c6622ca15639d86dd49f2..68ad7113ac3922e8c8d2dfc7bc7d329402c4421f 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -76,7 +76,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 @@ -167,6 +167,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 *);