From patchwork Fri Mar 25 17:25:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 8672631 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5589EC0553 for ; Fri, 25 Mar 2016 17:26:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C337202E9 for ; Fri, 25 Mar 2016 17:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DA47202E5 for ; Fri, 25 Mar 2016 17:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754069AbcCYR0Q (ORCPT ); Fri, 25 Mar 2016 13:26:16 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34102 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754038AbcCYR0O (ORCPT ); Fri, 25 Mar 2016 13:26:14 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u2PHKiC8024623 for ; Fri, 25 Mar 2016 10:26:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=IBTkUCSirbQ984j9JBPexV2AhtUmrH/3dTFTUKayZlA=; b=eMBF5X9qVVjFiZJ+gJU8XxQqNpefhWud6on6Zulf/i8j7YCxwsKf8gSq1CE/1mjhF654 lh/lfJQajc9q/JdBWcKQz0Tn5O08zJWyx+P9eitWRnsnyyyqp49kj/n/hxSPNc3c0q/v 8KXeQpVaso/VNWFp2fDNEJSoenzsWQR9nAU= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 21w972051p-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 25 Mar 2016 10:26:13 -0700 Received: from localhost (192.168.52.123) by mail.thefacebook.com (192.168.16.21) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 25 Mar 2016 10:26:12 -0700 From: Josef Bacik To: Subject: [PATCH 05/14] Btrfs: warn_on for unaccounted spaces Date: Fri, 25 Mar 2016 13:25:51 -0400 Message-ID: <1458926760-17563-6-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458926760-17563-1-git-send-email-jbacik@fb.com> References: <1458926760-17563-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-25_04:, , signatures=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These were hidden behind enospc_debug, which isn't helpful as they indicate actual bugs, unlike the rest of the enospc_debug stuff which is really debug information. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/extent-tree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 157a0b6..90ac821 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -9633,13 +9633,15 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) space_info = list_entry(info->space_info.next, struct btrfs_space_info, list); - if (btrfs_test_opt(info->tree_root, ENOSPC_DEBUG)) { - if (WARN_ON(space_info->bytes_pinned > 0 || + + /* + * Do not hide this behind enospc_debug, this is actually + * important and indicates a real bug if this happens. + */ + if (WARN_ON(space_info->bytes_pinned > 0 || space_info->bytes_reserved > 0 || - space_info->bytes_may_use > 0)) { - dump_space_info(space_info, 0, 0); - } - } + space_info->bytes_may_use > 0)) + dump_space_info(space_info, 0, 0); list_del(&space_info->list); for (i = 0; i < BTRFS_NR_RAID_TYPES; i++) { struct kobject *kobj;