This is a note to let you know that I've just added the patch titled Btrfs: account for orphan inodes properly during cleanup to the 3.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-account-for-orphan-inodes-properly-during-cleanup.patch and it can be found in the queue-3.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 925396ecf251432d6d0f703a6cfd0cb9e651d936 Mon Sep 17 00:00:00 2001 From: Josef Bacik <jbacik@xxxxxxxxxxxx> Date: Fri, 1 Feb 2013 15:57:47 -0500 Subject: Btrfs: account for orphan inodes properly during cleanup From: Josef Bacik <jbacik@xxxxxxxxxxxx> 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@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2470,6 +2470,7 @@ int btrfs_orphan_cleanup(struct btrfs_ro */ set_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, &BTRFS_I(inode)->runtime_flags); + atomic_inc(&root->orphan_inodes); /* if we have links, this was a truncate, lets do that */ if (inode->i_nlink) { Patches currently in stable-queue which might be from jbacik@xxxxxxxxxxxx are queue-3.8/btrfs-cleanup-orphan-reservation-if-truncate-fails.patch queue-3.8/btrfs-delete-inline-extents-when-we-find-them-during-logging.patch queue-3.8/btrfs-account-for-orphan-inodes-properly-during-cleanup.patch queue-3.8/btrfs-copy-everything-if-we-ve-created-an-inline-extent.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html