From patchwork Mon Feb 9 20:03:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 5803161 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 28FFBBF440 for ; Mon, 9 Feb 2015 20:03:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55E782011D for ; Mon, 9 Feb 2015 20:03:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 804A62011B for ; Mon, 9 Feb 2015 20:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760895AbbBIUDw (ORCPT ); Mon, 9 Feb 2015 15:03:52 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:58704 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760826AbbBIUDu (ORCPT ); Mon, 9 Feb 2015 15:03:50 -0500 Received: from pps.filterd (m0004348 [127.0.0.1]) by m0004348.ppops.net (8.14.5/8.14.5) with SMTP id t19JxVNa017686; Mon, 9 Feb 2015 12:03:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wit.ai; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=mx2; bh=pw7OBZ0gbarhazESBA34CK8wuHe3bb8Y2NxNR1HyVGA=; b=TFMQCrgJJRIhPAxX2PYfTOcRR/am+aKKt6WJJPIFIxXcZkXCvZJm98C+HCSOkSOUez9l cmJ/ihzOL6z2lwlNtzUy9Z3BxWny9Sg2/kVYt5iX6M4mCo8AUsozMXZXZoCt6JuXYlhb sW1/SvZw7oPC62+vOlHLlSzcFwkx025kO3rB4lgu5VzFSTasRfSusmg6dND2+lR6AYOL aeiuwnvC9kiS7Wek3ale7K5xzAPTsCHKsorf+Dq+LZWxsdJ8+ehyO+CDlXImGIL2G2hu usECvWVNwk7S1UQ+VI1pUx3g5ljwkHyvdPseuwWMexXbajMvE6mKGuaqBECipk5R2GMG ig== 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=pw7OBZ0gbarhazESBA34CK8wuHe3bb8Y2NxNR1HyVGA=; b=g754Ku7B0k7QyES49hAqoqLvKq+YR947k5AjuvQNiNNT5wb3PyUiVYuPMKmaI1JLYERd v41SDxB8M5uY4mcycLMMt+KIfvhdWJN8WiH+JD4Vf5DX5sVcJpuQPkPVyakM6KSFbPA7 Z/Fre3ctXn1ogvp2SybBy713kE0NSQxK6ns= Received: from mail.thefacebook.com ([199.201.64.23]) by m0004348.ppops.net with ESMTP id 1sf33hr23p-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Feb 2015 12:03:47 -0800 Received: from localhost (192.168.57.29) by mail.thefacebook.com (192.168.16.14) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 9 Feb 2015 12:03:46 -0800 From: Josef Bacik To: , Subject: [PATCH 12/16] Btrfs-progs: unpin excluded extents as we fix things Date: Mon, 9 Feb 2015 15:03:15 -0500 Message-ID: <1423512199-16552-13-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1423512199-16552-1-git-send-email-jbacik@fb.com> References: <1423512199-16552-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.57.29] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68, 1.0.33, 0.0.0000 definitions=2015-02-09_02:2015-02-09, 2015-02-08, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=2.87009407511322 compositescore=0.980601274849849 urlsuspect_oldscore=0.980601274849849 suspectscore=2 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=64355 rbsscore=0.980601274849849 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1502090196 X-FB-Internal: deliver Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 We don't want to keep extent records pinned down if we fix stuff as we may need the space and we can be pretty sure that these records are correct. Thanks, Signed-off-by: Josef Bacik --- cmds-check.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 5458c28..9c379e6 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -7335,6 +7335,8 @@ static int check_extent_refs(struct btrfs_root *root, return -EAGAIN; while(1) { + int cur_err = 0; + fixed = 0; recorded = 0; cache = search_cache_extent(extent_cache, 0); @@ -7345,6 +7347,7 @@ static int check_extent_refs(struct btrfs_root *root, fprintf(stderr, "extent item %llu has multiple extent " "items\n", (unsigned long long)rec->start); err = 1; + cur_err = 1; } if (rec->refs != rec->extent_item_refs) { @@ -7374,7 +7377,7 @@ static int check_extent_refs(struct btrfs_root *root, } } err = 1; - + cur_err = 1; } if (all_backpointers_checked(rec, 1)) { fprintf(stderr, "backpointer mismatch on [%llu %llu]\n", @@ -7388,6 +7391,7 @@ static int check_extent_refs(struct btrfs_root *root, goto repair_abort; fixed = 1; } + cur_err = 1; err = 1; } if (!rec->owner_ref_checked) { @@ -7402,10 +7406,16 @@ static int check_extent_refs(struct btrfs_root *root, fixed = 1; } err = 1; + cur_err = 1; } remove_cache_extent(extent_cache, cache); free_all_extent_backrefs(rec); + if (!init_extent_tree && repair && (!cur_err || fixed)) + clear_extent_dirty(root->fs_info->excluded_extents, + rec->start, + rec->start + rec->max_size - 1, + GFP_NOFS); free(rec); } repair_abort: