]> git.neil.brown.name Git - history.git/commitdiff
[XFS] Fix lock leak in xfs_free_file_space
authorDean Roehrich <roehrich@sgi.com>
Thu, 19 Aug 2004 22:06:03 +0000 (08:06 +1000)
committerNathan Scott <nathans@lips.borg.umn.edu>
Thu, 19 Aug 2004 22:06:03 +0000 (08:06 +1000)
SGI Modid: xfs-linux:xfs-kern:176905a
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_vnodeops.c

index 72a04a11cec4deb5b0a9e2da1a0e9efff179693b..d94fb9d9338b6601e3bf0ca55e266613ee46e36c 100644 (file)
@@ -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);