From patchwork Fri Jan 15 20:08:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 73208 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0FK8Rj9016366 for ; Fri, 15 Jan 2010 20:08:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757851Ab0AOUIZ (ORCPT ); Fri, 15 Jan 2010 15:08:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758117Ab0AOUIZ (ORCPT ); Fri, 15 Jan 2010 15:08:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37461 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319Ab0AOUIZ (ORCPT ); Fri, 15 Jan 2010 15:08:25 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0FK8N5b028133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jan 2010 15:08:23 -0500 Received: from localhost.localdomain (vpn-8-127.rdu.redhat.com [10.11.8.127]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0FK8MKB000884; Fri, 15 Jan 2010 15:08:23 -0500 Date: Fri, 15 Jan 2010 15:08:22 -0500 From: Josef Bacik To: linux-btrfs@vger.kernel.org Cc: tomas.carnecky@gmail.com Subject: [PATCH] Btrfs: fix regression in orphan cleanup Message-ID: <20100115200821.GA3699@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5440bab..f5d9384 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3796,6 +3796,12 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) if (location.type == BTRFS_INODE_ITEM_KEY) { inode = btrfs_iget(dir->i_sb, &location, root); + if (unlikely(root->clean_orphans) && + !(inode->i_sb->s_flags & MS_RDONLY)) { + down_read(&root->fs_info->cleanup_work_sem); + btrfs_orphan_cleanup(root); + up_read(&root->fs_info->cleanup_work_sem); + } return inode; }