Commit 3ccebd8b authored by Dean Roehrich's avatar Dean Roehrich Committed by Nathan Scott

[XFS] Fix lock leak in xfs_free_file_space

SGI Modid: xfs-linux:xfs-kern:176905a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent cb8fb432
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment