From patchwork Mon Mar 11 12:07:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 226553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 374172C02BF for ; Mon, 11 Mar 2013 23:08:07 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UF1WL-0001II-5x; Mon, 11 Mar 2013 12:08:01 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UF1WJ-0001Ge-AO for kernel-team@lists.ubuntu.com; Mon, 11 Mar 2013 12:07:59 +0000 Received: from bl15-242-192.dsl.telepac.pt ([188.80.242.192] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UF1WJ-0002tW-4H; Mon, 11 Mar 2013 12:07:59 +0000 From: Luis Henriques To: Josef Bacik Subject: [ 3.5.y.z extended stable ] Patch "Btrfs: account for orphan inodes properly during cleanup" has been added to staging queue Date: Mon, 11 Mar 2013 12:07:58 +0000 Message-Id: <1363003678-3545-1-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-Extended-Stable: 3.5 Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled Btrfs: account for orphan inodes properly during cleanup to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.5.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Luis ------ From bd72f8500a466ee488be92d3778231c1dab0e308 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 1 Feb 2013 15:57:47 -0500 Subject: [PATCH] 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 Signed-off-by: Luis Henriques --- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+) -- 1.8.1.2 diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a7d1921..fadf1c3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2433,6 +2433,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root) */ 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) {