]> Pileus Git - ~andy/linux/blobdiff - fs/xfs/xfs_bmap.c
[XFS] Fix double free of log tickets
[~andy/linux] / fs / xfs / xfs_bmap.c
index db289050692f4fe4a95c791d427151b92c92fbdf..c3912213645c6a5e17637f2b9f57441de8c8d9c9 100644 (file)
@@ -4292,9 +4292,15 @@ xfs_bmap_finish(
         * We have a new transaction, so we should return committed=1,
         * even though we're returning an error.
         */
-       if (error) {
+       if (error)
                return error;
-       }
+
+       /*
+        * transaction commit worked ok so we can drop the extra ticket
+        * reference that we gained in xfs_trans_dup()
+        */
+       xfs_log_ticket_put(ntp->t_ticket);
+
        if ((error = xfs_trans_reserve(ntp, 0, logres, 0, XFS_TRANS_PERM_LOG_RES,
                        logcount)))
                return error;