Btrfs: fix buffer leak in btrfs_next_old_leaf
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Wed, 4 Jul 2012 13:42:48 +0000 (15:42 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Tue, 10 Jul 2012 13:14:41 +0000 (15:14 +0200)
When calling btrfs_next_old_leaf, we were leaking an extent buffer in the
rare case of using the deadlock avoidance code needed for the tree mod log.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
fs/btrfs/ctree.c

index 8206b3900587efa23570b5b8f7f8071ab6e73156..67fe46fdee6f9c4af8ee7b9473fa00b7c6d9924b 100644 (file)
@@ -5127,6 +5127,7 @@ again:
                                 * locked. To solve this situation, we give up
                                 * on our lock and cycle.
                                 */
+                               free_extent_buffer(next);
                                btrfs_release_path(path);
                                cond_resched();
                                goto again;