From patchwork Mon Feb 9 20:03:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 5803121 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 B4388BF910 for ; Mon, 9 Feb 2015 20:03:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB55A20120 for ; Mon, 9 Feb 2015 20:03:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 124FC2011E for ; Mon, 9 Feb 2015 20:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760815AbbBIUDj (ORCPT ); Mon, 9 Feb 2015 15:03:39 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:15969 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760813AbbBIUDh (ORCPT ); Mon, 9 Feb 2015 15:03:37 -0500 Received: from pps.filterd (m0004347 [127.0.0.1]) by m0004347.ppops.net (8.14.5/8.14.5) with SMTP id t19K1Qci024624; Mon, 9 Feb 2015 12:03:35 -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=P/V3ZzCFJUjEnP551ybsqybs5cCmBaPzynaHir/Rm+M=; b=auqYg4WfPXn2sIcKYm1T6BtjiWuxRZSR3CIca4QgJDI444IFjtDzEwHvDxSvkU217SfL rDrtLSks3ieGZnLz78+/sUt5OWMCzQeEjUX1FVDOokLXws0eA/9MGAfRWXVNEzDRxx7i lKg/x5neyqo/ATgyQ4+pf9P7gmflvvKd5WoGEIgOLrh0jd/4FvsrKE0gvEgdLHeoVe7Y pg90PSd3Ok4jziF9bVcOtWa+cZYkmQuyuMUo+CRCPNoSSmebVGin40/ii2ZWmrHMuDLY 4BEOAF8yuDB8QI1yy73db5PCCzhY3QVke0GnHcDsbb7lx1Hm1HBBbI0HYGT8oM9bEF0R Ow== 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=P/V3ZzCFJUjEnP551ybsqybs5cCmBaPzynaHir/Rm+M=; b=p6AZi5TOKxUHYu4yFteKVDIuOmwaGlz5es0mTXR5M2NO1MG98G2POyQUKt6nQXyGrkOm d8cqAc3++li0yYl36WlcjNAqWqMu0aVDnbroTOT8L2Iemf1BAilu02i3HAx+WU8rY5Z/ jR2ufcDSazpJJ03h9x3tBrBLnIBsEiZ3iNI= Received: from mail.thefacebook.com ([199.201.64.23]) by m0004347.ppops.net with ESMTP id 1sf38pg1eh-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Feb 2015 12:03:35 -0800 Received: from localhost (192.168.57.29) by mail.TheFacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 9 Feb 2015 12:03:33 -0800 From: Josef Bacik To: , Subject: [PATCH 06/16] Btrfs-progs: don't check csums for data reloc root Date: Mon, 9 Feb 2015 15:03:09 -0500 Message-ID: <1423512199-16552-7-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=0 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-1502090197 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 The data reloc root is weird with it's csums. It'll copy an entire extent and then log any csums it finds, which makes it look weird when it comes to prealloc extents. So just skip the data reloc tree, it's special and we just don't need to worry about it. Thanks, Signed-off-by: Josef Bacik --- cmds-check.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 2b08c64..2163823 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -1530,7 +1530,16 @@ static int process_file_extent(struct btrfs_root *root, } rec->extent_end = key->offset + num_bytes; - if (disk_bytenr > 0) { + /* + * The data reloc tree will copy full extents into its inode and then + * copy the corresponding csums. Because the extent it copied could be + * a preallocated extent that hasn't been written to yet there may be no + * csums to copy, ergo we won't have csums for our file extent. This is + * ok so just don't bother checking csums if the inode belongs to the + * data reloc tree. + */ + if (disk_bytenr > 0 && + btrfs_header_owner(eb) != BTRFS_DATA_RELOC_TREE_OBJECTID) { u64 found; if (btrfs_file_extent_compression(eb, fi)) num_bytes = btrfs_file_extent_disk_num_bytes(eb, fi);