From patchwork Fri Feb 19 22:22:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 80837 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1JMKdYp006595 for ; Fri, 19 Feb 2010 22:20:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755752Ab0BSWUi (ORCPT ); Fri, 19 Feb 2010 17:20:38 -0500 Received: from cobra.newdream.net ([66.33.216.30]:37326 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754976Ab0BSWUh (ORCPT ); Fri, 19 Feb 2010 17:20:37 -0500 Received: from cobra.newdream.net (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 7D3CCBC7A7; Fri, 19 Feb 2010 14:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hq.newdream.net; h=date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type:content-id; s=drama; bh=qr39KJQHl5Tou eeowgSwCq2/ejg=; b=YtsqSIWWviFxwd7ANmt23JMR8gucsRmASZYVM8HIdiH4T j1B5+ex5UndOFBY3VOdDND0vLQziJ4BU4XkMyhe0guGnkqRUL46ePNdQysfl70iX uyAOsMK2E6POnl8VHLUcfcwEWaFYES5kPNFyX2G5u/YJdDmdKVupGxivgGR6HI= Received: by cobra.newdream.net (Postfix, from userid 1031) id 62FFDBCA5A; Fri, 19 Feb 2010 14:22:25 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 4ADD9BC7A7; Fri, 19 Feb 2010 14:22:25 -0800 (PST) Date: Fri, 19 Feb 2010 14:22:25 -0800 (PST) From: Sage Weil To: Mike Fedyk cc: sander@humilis.net, Josef Bacik , Chris Ball , Nickolai Zeldovich , linux-btrfs@vger.kernel.org Subject: Re: zero-length files in snapshots In-Reply-To: <93cdabd21002131126v4b4d3c1ei2a747a7a5de7b1c8@mail.gmail.com> Message-ID: References: <12b5f1ef1002111749u4f33b626jb6a901b29f05337f@mail.gmail.com> <93cdabd21002112050x795ab5e2s9bcd426f19032f8c@mail.gmail.com> <20100212151940.GA4191@localhost.localdomain> <93cdabd21002120818g4c47e2b6k3083a368286651e5@mail.gmail.com> <20100212162207.GB4191@localhost.localdomain> <93cdabd21002120827k493a4c1ao2ba4b6840f2ab427@mail.gmail.com> <20100212163246.GC4191@localhost.localdomain> <93cdabd21002120913h1b1eaa2cke8941aa8557b66f3@mail.gmail.com> <20100213112540.GB23512@attic.humilis.net> <93cdabd21002131126v4b4d3c1ei2a747a7a5de7b1c8@mail.gmail.com> MIME-Version: 1.0 Content-ID: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 19 Feb 2010 22:20:39 +0000 (UTC) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e83d4e1..f5b7029 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1084,13 +1084,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, mutex_unlock(&root->fs_info->trans_mutex); - if (flush_on_commit) { + if (flush_on_commit || snap_pending) { btrfs_start_delalloc_inodes(root, 1); ret = btrfs_wait_ordered_extents(root, 0, 1); BUG_ON(ret); - } else if (snap_pending) { - ret = btrfs_wait_ordered_extents(root, 0, 1); - BUG_ON(ret); } /*