summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_dir2_node.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 08:58:48 +0400
committerNathan Scott <nathans@sgi.com>2006-06-09 08:58:48 +0400
commite109007461cddfc80a908f0b015f4eeb485e1d85 (patch)
treebd3ce386cfce2905dd72182c4dbee2581bb76018 /fs/xfs/xfs_dir2_node.c
parent7d04a335b6b2d79e3742ffd28bd651204574e794 (diff)
downloadlinux-e109007461cddfc80a908f0b015f4eeb485e1d85.tar.xz
[XFS] Fix a buffer refcount leak in dir2 code on a forced shutdown.
SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26097a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/xfs_dir2_node.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index c0e8fcf5e13f..a8d483c0a84c 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -505,7 +505,6 @@ xfs_dir2_leafn_lookup_int(
XFS_DATA_FORK))) {
return error;
}
- curfdb = newfdb;
free = curbp->data;
ASSERT(be32_to_cpu(free->hdr.magic) ==
XFS_DIR2_FREE_MAGIC);
@@ -527,8 +526,11 @@ xfs_dir2_leafn_lookup_int(
if (unlikely(be16_to_cpu(free->bests[fi]) == NULLDATAOFF)) {
XFS_ERROR_REPORT("xfs_dir2_leafn_lookup_int",
XFS_ERRLEVEL_LOW, mp);
+ if (curfdb != newfdb)
+ xfs_da_brelse(tp, curbp);
return XFS_ERROR(EFSCORRUPTED);
}
+ curfdb = newfdb;
if (be16_to_cpu(free->bests[fi]) >= length) {
*indexp = index;
state->extravalid = 1;