From patchwork Tue Apr 2 13:46:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2378581 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 2A6623FDDA for ; Tue, 2 Apr 2013 13:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761028Ab3DBNqb (ORCPT ); Tue, 2 Apr 2013 09:46:31 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:36857 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754155Ab3DBNqa (ORCPT ); Tue, 2 Apr 2013 09:46:30 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 1FFC29A069C for ; Tue, 2 Apr 2013 07:46:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1364910390; bh=7i35jWNxlWnnyExMlXT6f7d8/jMaH6U8M5W02nOI3mo=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=jL5fkS4n9pOVrByXas5LPzRBTjStnKGRKub3F+cWHSoG1IsNMrC6A+S3wwblK1IT3 XevGzNlI1eegfRfnAK0K0a++J/434tGDDc3fNp0WhE7Q4mkQz54+E0mXMvSVJ0/Vd1 DvmPI/c2oNfP55QtZ5yf3ArdapZyjri9Kst1v8hw= X-ASG-Debug-ID: 1364910389-03d6a52ac0193370001-6jHSXT Received: from mail1.int.fusionio.com (mail1.int.fusionio.com [10.101.1.21]) by mx1.fusionio.com with ESMTP id cbGEihJwLuH0EcbT (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Tue, 02 Apr 2013 07:46:29 -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; Tue, 2 Apr 2013 07:46:28 -0600 Date: Tue, 2 Apr 2013 09:46:26 -0400 From: Josef Bacik To: Roman Mamedov CC: "linux-btrfs@vger.kernel.org" Subject: Re: Still getting a lot of -28 (ENOSPC?) errors during balance Message-ID: <20130402134626.GO1876@localhost.localdomain> X-ASG-Orig-Subj: Re: Still getting a lot of -28 (ENOSPC?) errors during balance References: <20130402140452.2b71794f@natsu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130402140452.2b71794f@natsu> User-Agent: Mutt/1.5.21 (2011-07-01) X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1364910389 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.126963 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 Tue, Apr 02, 2013 at 02:04:52AM -0600, Roman Mamedov wrote: > Hello, > > With kernel 3.7.10 patched with "Btrfs: limit the global reserve to 512mb". > (the problem was occuring also without this patch, but seemed to be even worse). > > At the start of balance: > > Data: total=31.85GB, used=9.96GB > System: total=4.00MB, used=16.00KB > Metadata: total=1.01GB, used=696.17MB > > "btrfs balance start -musage=5 -dusage=5" is going on for about 50 minutes > > Current situation: > > Balance on '/mnt/r1/' is running > 1 out of about 2 chunks balanced (20 considered), 50% left > > Data: total=30.85GB, used=10.04GB > System: total=4.00MB, used=16.00KB > Metadata: total=1.01GB, used=851.69MB > > And a constant stream of these in dmesg: > Can you try this out and see if it helps? Thanks, Josef --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 0d89ff0..9830e86 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2548,6 +2548,13 @@ static int do_relocation(struct btrfs_trans_handle *trans, list_for_each_entry(edge, &node->upper, list[LOWER]) { cond_resched(); + ret = btrfs_block_rsv_refill(rc->extent_root, rc->block_rsv, + rc->extent_root->leafsize, + BTRFS_RESERVE_FLUSH_ALL); + if (ret) { + err = ret; + break; + } upper = edge->node[UPPER]; root = select_reloc_root(trans, rc, upper, edges, &nr); BUG_ON(!root);