Btrfs: add some missing iput()'s in btrfs_orphan_cleanup
authorJosef Bacik <jbacik@fusionio.com>
Mon, 3 Jun 2013 20:51:23 +0000 (16:51 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Fri, 14 Jun 2013 15:30:15 +0000 (11:30 -0400)
There are some error cases that we don't do an iput() on our inode, fix this.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c

index c0e95b1554a00141f98dcb805d7c0040b49be656..c52ceb8c24e0f65feb80deb6de3c7ce3783beb9b 100644 (file)
@@ -3234,13 +3234,16 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
                        /* 1 for the orphan item deletion. */
                        trans = btrfs_start_transaction(root, 1);
                        if (IS_ERR(trans)) {
+                               iput(inode);
                                ret = PTR_ERR(trans);
                                goto out;
                        }
                        ret = btrfs_orphan_add(trans, inode);
                        btrfs_end_transaction(trans, root);
-                       if (ret)
+                       if (ret) {
+                               iput(inode);
                                goto out;
+                       }
 
                        ret = btrfs_truncate(inode);
                        if (ret)