From patchwork Wed Aug 24 15:57:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9298029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0450C607F0 for ; Wed, 24 Aug 2016 15:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E946E28638 for ; Wed, 24 Aug 2016 15:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDD34290DF; Wed, 24 Aug 2016 15:58:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24F1B28638 for ; Wed, 24 Aug 2016 15:58:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbcHXP6N (ORCPT ); Wed, 24 Aug 2016 11:58:13 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:64022 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753322AbcHXP6K (ORCPT ); Wed, 24 Aug 2016 11:58:10 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.17/8.16.0.17) with SMTP id u7OFsZe0006000 for ; Wed, 24 Aug 2016 08:58:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=facebook; bh=F4ZFVpwsgPAYUqGNpG8EGjb3eaZltkjIH2t6WOlzBOM=; b=hRUSjP6C9hYS8917flEEqMBEIm1R50Dxjx1LELXoGzLDtZg9m9W2bQNX07NF/4Mk3Kzv ++FBTqu45lu+LX8T+fDHwA5blqoNYyLjReJL6t45+dbiLtiqcOPu5mcNnlXTeGdguQwb I1Qrrx6qZMO5xo6j+hYkNqIHHRzPTGwQvfM= Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 250upxfwb3-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 24 Aug 2016 08:58:09 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 24 Aug 2016 08:58:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KZHvVo0l3IsfRR1GJ5VpqU2GoKPJkdekLHvIsoVBLK0=; b=GiPBsQRzfI9vL5XXebMjK5/GeRHN/07yKPMf2WTVpjmlzYWbZYI2titRnMrXwn6S/nXsI+QfrHklKy1ksAEyf4DxrMG4NZTYYYdRMRcdRE7ANZ4+plXFR9xRT1WaWX5nhbz5SxEKDkwJjtlmg63ebz2Leu6W8gsHHABwizilTvs= Received: from localhost (107.15.72.49) by BN6PR15MB1316.namprd15.prod.outlook.com (10.172.206.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Wed, 24 Aug 2016 15:58:02 +0000 From: Josef Bacik To: , Subject: [PATCH][v2] Btrfs: kill invalid ASSERT() in process_all_refs() Date: Wed, 24 Aug 2016 11:57:52 -0400 Message-ID: <1472054272-23792-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [107.15.72.49] X-ClientProxiedBy: DM5PR08CA0018.namprd08.prod.outlook.com (10.175.218.28) To BN6PR15MB1316.namprd15.prod.outlook.com (10.172.206.142) X-MS-Office365-Filtering-Correlation-Id: 73275d0e-c8d0-4dc3-aa73-08d3cc376da1 X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1316; 2:NGqIp5nTsQZoWRo1UV+nVQx7oid1Ap1ET2J3dl8AvPXG7M404WA8YbOToKJHiDUevbHouSneNqAhxg4mp3P3V5E6m+cxUQdizMVuUPqeS956Ltpp6aYQnDkfEu/50u21hC5qrcasIE9qTRPtsQAE0+QA65dRKPJU7ThGwkUEuYFl7oN56c4eFFXpapVaBLl2; 3:+jqNLQF803+iK0DFEBUlhCub1vcKI66Gj8uOSltAGtnSbdvbsAtEdM40ebi7Xj83tUFVfSoKX5MAWzJJJ9teWvEQ/tcdygJvnWIgfyilhk6HcsaKdsPWI98Tre5Ral6e; 25:pwxFS3uZlLGhhzKN4em3mTZr+4D8GIm3SeEyc3C2dVVDIsG08fRQ7mL9QvSF/dotoZ2shV8YLNjv7xpXTmlhFktunNB2dj3AiRak0MVxxRlI0e8R2vzWlZjlb/K5B6SFI0C9HtkbiRLqAWJxExUEMds5qELspje7KrQ3DsvuOa4Zp3dXnwOJPVOuC5gYRbRhD0h1CypSmquI9J5Yo93lOue8g0XWWP2fYwatt4Gqx0L1qnNR8Y8CO8UyX03pPd7vDPUxCpAe+amcwqTNez9JsUsc3eFLNvJHNApeLKxGl5J1iWnNUUPsoTX5ODi9n42NoAJPc3DNV5IocdynX1Zunha/uVZbJevNfNM22huUC/31xE3PMXsUoXFbJL9h84LKWCuMP0XYoGPLFCT29t1aj4ha5ZtP18lco7G6pEANEOs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1316; X-LD-Processed: 8ae927fe-1255-47a7-a2af-5f3a069daaa2,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1316; 31:dkof9fKDHdNFcjB2XAbzgI37f5Velbes2LT1oyTQ5RBbX3aPZXA2ZFIrreMsTTSlLMgNMBYZWI+bDo4exJBMtkRxiXnmY8mQwdmeU+boEjWk1zeEmmR7BjFYteDbhOdijBHF9tie5roeedbvs/CVT6p/schb0BDcTDzxNnuFzugaVeEdVrGun/Ty3h3fScxc1SJFBERsPQ8sj7pdcUU0I6COdNGdUMaeGL8uCKMszyw=; 20:MNJ8+93o5ZdFhcMTfachnrCW/bKvAeQ46J8S6NuSh5mmtI0Dm5VFshfPqKcWNJxNE0MAQpQY7CV8OClt8bHfKKXod/eqPCVfQFc8vfz3LdMpMfDUPtWL0QfmJAHIrm2SbcUOhlcXk5P0rJ/dsw9rFjVBZUUC17dPG2Hn34cHJxA=; 4:BJtVRXPBZYVruw4+OwKlDDj4uc+X4775dORaw/LO0ne96KOR/rdSXEJqpsFShUw/DfSstFkuOcvDxE4rSxedOXLMVq3lUVmqWiozAp6XbEPBO2IXdsDN1UTZcQNx6GkP/UHnZGTjWmM+q3RWNy06meFMSJXZ29y2XZY3j6G3RSxuYlDOX0EUm4FxRKtjrO1FS86MQ4mUY5CifQd8vVu1yp84bvSlCdhd1qz4wBSB37g+ouRxZuGPiq+26g1CTdb2vuCQ1eyONNdzT1SuQLiqTrPrw595IAbXEpVI9uavMNcjm8RmNGv8aYidl6XlDlADIVyZ66Zvdz2WP0pkroDgtjJAGjg9ATszKfo6klef5hvZadp5xNWNIjIvU5X4YD5BrKeTIFEPOcmXs5xoybCosomkPQe7zMq7/EmzH1YhzFBOzWYo1DjFGkXdvfKRlkgk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN6PR15MB1316; BCL:0; PCL:0; RULEID:; SRVR:BN6PR15MB1316; X-Forefront-PRVS: 0044C17179 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(54534003)(189002)(199003)(50466002)(305945005)(105586002)(81156014)(47776003)(7736002)(66066001)(76506005)(8676002)(7846002)(2870700001)(107886002)(92566002)(189998001)(5001770100001)(19580405001)(23676002)(101416001)(86362001)(81166006)(97736004)(77096005)(106356001)(42186005)(229853001)(6116002)(3846002)(5820100001)(68736007)(50226002)(450100001)(36756003)(586003)(50986999)(5660300001)(33646002)(2906002)(19580395003)(4720700001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR15MB1316; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjE1TUIxMzE2OzIzOmNzRVlLdTBwckRtTnlJYmUvZCtySjhPQXg5?= =?utf-8?B?RzVCeUEwcmtxaFJiV1ZwSC9Ua1RlUTZCQy9rYU9mVkZic1Awcm5xNjgrSGlk?= =?utf-8?B?ajFJaUhrMENQUlB3WFhVeHZYMHcyUHJsQ2ZoYnplVTFFZWRwQVBRNS95U1do?= =?utf-8?B?T1RPWHhWMi9NdTU5cmVlS044Z3pUOUFkYUdKbGVaS25WaUxmZGRwWDhXNkxx?= =?utf-8?B?UkJ4bWNrK0p3Ty9mYk44bngvOU9ORjloemVuSUEyalV3L0FiSXdTOWNUY1lx?= =?utf-8?B?QllaV3BYWUQrQXN2YVZtenJ5SWN6YkV5QmFrcGprWVl1K2RjcXFLTVZDd2RM?= =?utf-8?B?cW5zMkxYRTlrcklQVU1QeUVVZks5WXFjVC9OT3JsVEtRYUd2TXBRYm5jbDlt?= =?utf-8?B?Qlc2dlpsVCs5eVV0OW5jK0VLNzRHblpWSlJCMGJhOHBtZjFoVXdCNmNxSFNH?= =?utf-8?B?TjFDZUk2N2IySlUrUlJ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Ws//yUpfSQ1U+ys9/bWIlVOczU5n1Et8eLzBla SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1316; 20:o/0PSD/xiUQwtN1JUGF1mlETcsIrZNb6lTdeXZElujZq4eotQT1CtRBRWrCVBh28dHXGzbjWH+hbp9wKLWuKoUjyBDIpjQx29iGQ8MeETPCpKpcInsb89h+nN5ZGYZXhUYFJL1esnudDdgrnhxMwIe3QLbEfaRWvH9DXM7RAtro= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2016 15:58:02.1488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1316 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-24_08:, , signatures=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Suppose you have the following tree in snap1 on a file system mounted with -o inode_cache so that inode numbers are recycled └── [ 258] a └── [ 257] b and then you remove b, rename a to c, and then re-create b in c so you have the following tree └── [ 258] c └── [ 257] b and then you try to do an incremental send you will hit ASSERT(pending_move == 0); in process_all_refs(). This is because we assume that any recycling of inodes will not have a pending change in our path, which isn't the case. This is the case for the DELETE side, since we want to remove the old file using the old path, but on the create side we could have a pending move and need to do the normal pending rename dance. So remove this ASSERT() and put a comment about why we ignore pending_move. Thanks, Signed-off-by: Josef Bacik --- v1->v2: -turns out send does the right thing without the ASSERT() in place, I must have loaded the wrong module when testing, so just kill the ASSERT(). -adjusted the changelog to reflect the actual fix. fs/btrfs/send.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index b71dd29..375c45b 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -4126,10 +4126,12 @@ static int process_all_refs(struct send_ctx *sctx, } btrfs_release_path(path); + /* + * We don't actually care about pending_move as we are simply + * re-creating this inode and will be rename'ing it into place once we + * rename the parent directory. + */ ret = process_recorded_refs(sctx, &pending_move); - /* Only applicable to an incremental send. */ - ASSERT(pending_move == 0); - out: btrfs_free_path(path); return ret;