Btrfs: account for orphan inodes properly during cleanup
authorJosef Bacik <jbacik@fusionio.com>
Fri, 1 Feb 2013 20:57:47 +0000 (15:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 18:26:35 +0000 (11:26 -0700)
commit5f62c696e2fed435824de55e6ceba73abe2304bf
tree4472cb7efdc70b0d0d495bacf52a3b418540ae3b
parentf3df1362f80a077d32b1d15069e1ee5697937336
Btrfs: account for orphan inodes properly during cleanup

commit 925396ecf251432d6d0f703a6cfd0cb9e651d936 upstream.

Dave sent me a panic where we were doing the orphan cleanup and panic'ed
trying to release our reservation from the orphan block rsv.  The reason for
this is because our orphan block rsv had been free'd out from underneath us
because the transaction commit found that there were no orphan inodes
according to its count and decided to free it.  This is incorrect so make
sure we inc the orphan inodes count so the accounting is all done properly.
This would also cause the warning in the orphan commit code normally if you
had any orphans to cleanup as they would only decrement the orphan count so
you'd get a negative orphan count which could cause problems during runtime.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c