From patchwork Fri Mar 22 15:54:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2321551 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1484A3FD8C for ; Fri, 22 Mar 2013 15:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933715Ab3CVPy5 (ORCPT ); Fri, 22 Mar 2013 11:54:57 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:34097 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933516Ab3CVPy4 (ORCPT ); Fri, 22 Mar 2013 11:54:56 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 6E1AC9A068A for ; Fri, 22 Mar 2013 09:54:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1363967696; bh=N57iu7FlSvP8pT2p+pit+I3uSxb64RoUZXae+U5bK6c=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=SGwvVslKZAV3SkqynxYYEUwCS8ipVDlh7dzx/J2gFesOl2+Mv8eG6Rdzkv/JEWpD/ LsKqjrl/L7nsfuNqhALoFDGVAWEheXqNgikKJkc6UBQO8JpZ/7u9tm2GoHch5DsXr5 zXxXPa8VlAZuq5TgrKKKdngxtvA+A+QH1jKqj2h4= X-ASG-Debug-ID: 1363967695-03d6a52ac0a65e0001-6jHSXT Received: from mail1.int.fusionio.com (mail1.int.fusionio.com [10.101.1.21]) by mx1.fusionio.com with ESMTP id ASh8pr37fDK5cUEW (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 22 Mar 2013 09:54:55 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (98.26.82.158) by mail.fusionio.com (10.101.1.19) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 22 Mar 2013 09:54:55 -0600 Date: Fri, 22 Mar 2013 11:54:53 -0400 From: Josef Bacik To: Stefan Priebe - Profihost AG CC: Josef Bacik , Chris Mason , "linux-btrfs@vger.kernel.org" Subject: Re: No space left on device (28) Message-ID: <20130322155453.GD1955@localhost.localdomain> X-ASG-Orig-Subj: Re: No space left on device (28) References: <514ABEB8.3090104@profihost.ag> <20130321180020.30044.84729@localhost.localdomain> <967ED686-7E9C-4158-80A0-D58D18818BA2@profihost.ag> <20130321190249.30044.79438@localhost.localdomain> <514B62A4.1030201@profihost.ag> <5F36F35C-39BE-4244-B8FB-A80EC2B06D48@profihost.ag> <514C4A8C.90607@profihost.ag> <20130322135322.GB1955@localhost.localdomain> <514C6319.7030400@profihost.ag> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <514C6319.7030400@profihost.ag> User-Agent: Mutt/1.5.21 (2011-07-01) X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1363967695 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.125923 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Mar 22, 2013 at 07:56:41AM -0600, Stefan Priebe - Profihost AG wrote: > Hi Josef, > Am 22.03.2013 14:53, schrieb Josef Bacik: > > On Fri, Mar 22, 2013 at 06:11:56AM -0600, Stefan Priebe - Profihost AG wrote: > >> Hi Chris, > >> > >>>>>>> Which kernel are you running? > >>>>>>> > >>>>>>> -chris > >>>>>> > >>>>>> vanilla 3.8.3. > >>>>> > >>>>> Ok, with the 3.9 merge window Josef changed how we do the reservations. > >>>>> Are you able to try a slightly more experimental kernel? > >> > >> any ideas what i can check? 3.9-rc3 gives me same results. > >> > > > > Sorry Stefan I'm almost done with what I'm working on and then I'll work up a > > patch for you to run so I can narrow down what's going on. Thanks, > > Great! > > Thanks - just wanted to know that it's not my fault. I'm happy to test > the patch and provide feedback. > Ok I think we are way over-reserving for rename, can you give this patch a whirl and see what happens? If it still fails can you capture dmesg and reply with that so I can see what's going on. Thanks, Josef diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9ac2eca..aabaea6 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4161,6 +4161,11 @@ out: ret = 0; } if (flushing) { + if (ret == -ENOSPC) { + printk(KERN_ERR "returning enospc, dumping space info\n"); + dump_space_info(space_info, 0, 0); + } + spin_lock(&space_info->lock); space_info->flush = 0; wake_up_all(&space_info->wait); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca1b767..3980ae7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3679,11 +3679,9 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir, * 1 for the dir item * 1 for the dir index * 1 for the inode ref - * 1 for the inode ref in the tree log - * 2 for the dir entries in the log * 1 for the inode */ - trans = btrfs_start_transaction(root, 8); + trans = btrfs_start_transaction(root, 5); if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC) return trans; @@ -8127,7 +8125,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, * inodes. So 5 * 2 is 10, plus 1 for the new link, so 11 total items * should cover the worst case number of items we'll modify. */ - trans = btrfs_start_transaction(root, 20); + trans = btrfs_start_transaction(root, 11); if (IS_ERR(trans)) { ret = PTR_ERR(trans); goto out_notrans;