summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChandra Seetharaman2011-09-20 15:56:55 +0200
committerAlex Elder2011-10-12 04:15:01 +0200
commit2a30f36d9069b0646dcdd73def5fd7ab674bffd6 (patch)
treed7be19830eaa3c85b9e06882ccec369630ce9ca2 /fs/xfs/xfs_vnodeops.c
parentxfs: Check the return value of xfs_buf_get() (diff)
downloadkernel-qcow2-linux-2a30f36d9069b0646dcdd73def5fd7ab674bffd6.tar.gz
kernel-qcow2-linux-2a30f36d9069b0646dcdd73def5fd7ab674bffd6.tar.xz
kernel-qcow2-linux-2a30f36d9069b0646dcdd73def5fd7ab674bffd6.zip
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>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index c2ff0fc86567..0d1caec873a1 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -308,6 +308,10 @@ xfs_inactive_symlink_rmt(
bp = xfs_trans_get_buf(tp, mp->m_ddev_targp,
XFS_FSB_TO_DADDR(mp, mval[i].br_startblock),
XFS_FSB_TO_BB(mp, mval[i].br_blockcount), 0);
+ if (!bp) {
+ error = ENOMEM;
+ goto error1;
+ }
xfs_trans_binval(tp, bp);
}
/*
@@ -1648,7 +1652,10 @@ xfs_symlink(
byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount);
bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d,
BTOBB(byte_cnt), 0);
- ASSERT(!xfs_buf_geterror(bp));
+ if (!bp) {
+ error = ENOMEM;
+ goto error2;
+ }
if (pathlen < byte_cnt) {
byte_cnt = pathlen;
}