xfs: Check the return value of xfs_trans_get_buf()

Check the return value of xfs_trans_get_buf() and fail
appropriately.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
Chandra Seetharaman 2011-09-20 13:56:55 +00:00 committed by Alex Elder
parent b522950f0a
commit 2a30f36d90
6 changed files with 30 additions and 11 deletions

View file

@ -150,7 +150,7 @@ xfs_check_agi_freecount(
/*
* Initialise a new set of inodes.
*/
STATIC void
STATIC int
xfs_ialloc_inode_init(
struct xfs_mount *mp,
struct xfs_trans *tp,
@ -202,8 +202,8 @@ xfs_ialloc_inode_init(
fbuf = xfs_trans_get_buf(tp, mp->m_ddev_targp, d,
mp->m_bsize * blks_per_cluster,
XBF_LOCK);
ASSERT(!xfs_buf_geterror(fbuf));
if (!fbuf)
return ENOMEM;
/*
* Initialize all inodes in this buffer and then log them.
*
@ -225,6 +225,7 @@ xfs_ialloc_inode_init(
}
xfs_trans_inode_alloc_buf(tp, fbuf);
}
return 0;
}
/*
@ -369,9 +370,11 @@ xfs_ialloc_ag_alloc(
* rather than a linear progression to prevent the next generation
* number from being easily guessable.
*/
xfs_ialloc_inode_init(args.mp, tp, agno, args.agbno, args.len,
random32());
error = xfs_ialloc_inode_init(args.mp, tp, agno, args.agbno,
args.len, random32());
if (error)
return error;
/*
* Convert the results.
*/