mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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:
parent
b522950f0a
commit
2a30f36d90
6 changed files with 30 additions and 11 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue