From 3ccebd8bb9724c9e2824b7c5f92477540a21dca5 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Fri, 20 Aug 2004 08:06:03 +1000 Subject: [PATCH] [XFS] Fix lock leak in xfs_free_file_space SGI Modid: xfs-linux:xfs-kern:176905a Signed-off-by: Nathan Scott --- fs/xfs/xfs_vnodeops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 72a04a11cec4d..d94fb9d9338b6 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -4337,8 +4337,10 @@ xfs_free_file_space( nimap = 1; error = xfs_bmapi(NULL, ip, startoffset_fsb, 1, 0, NULL, 0, &imap, &nimap, NULL); - if (error) + if (error) { + xfs_iunlock(ip, XFS_IOLOCK_EXCL); return error; + } ASSERT(nimap == 0 || nimap == 1); if (nimap && imap.br_startblock != HOLESTARTBLOCK) { xfs_daddr_t block; @@ -4352,8 +4354,10 @@ xfs_free_file_space( nimap = 1; error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, 1, 0, NULL, 0, &imap, &nimap, NULL); - if (error) + if (error) { + xfs_iunlock(ip, XFS_IOLOCK_EXCL); return error; + } ASSERT(nimap == 0 || nimap == 1); if (nimap && imap.br_startblock != HOLESTARTBLOCK) { ASSERT(imap.br_startblock != DELAYSTARTBLOCK); -- 2.53.0