Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4440455imw; Tue, 12 Jul 2022 08:01:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ubqL/eF2vJAS1kDxXVICbA1WWKNiI4My+5ZAn7uRtob97y+2Q3Q4k2p43lJ4fVRl42Kjhv X-Received: by 2002:a17:902:d4ce:b0:16c:3d34:fdbe with SMTP id o14-20020a170902d4ce00b0016c3d34fdbemr15370772plg.15.1657638086903; Tue, 12 Jul 2022 08:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657638086; cv=none; d=google.com; s=arc-20160816; b=ZkPNxPqS+7B822TbbQ0HpBxC89yhbJy9g0U/porohvrHRgEW38yemyXmIDiVcXTUh0 c8JxHhTNQJT63mcI3B7u2yrLmmeXiVthFhklMS8IpqcHO4CHUNngwnCUjlQYUsNArOGz itrnLOklP0KWxF5BHYMyParSmOuWVSD/5GbpXNErhHBK2Yy3OS01Y5zhxjtyBhwnf4Ik L3eUfzItma3EladZ3S1ANhNvFupRFYmkRRBNfa+gczh29hpv1loluO/oDbCq1H0j4H0/ 56j4eWm+gok6jR5D2dynfe3+cvUGC+XQh2nbaj4pISWLuHN8VuMsgxaB/pWKVMSxgXK4 U9Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nveFP1ozgumwjPMqy1QwMI5K3RHDdE2nN+SyujnhzX4=; b=QT8MYzUgkniaEP83hS2yfSn7WlA8rAz5M9bdRmoHJ8uxoPWjbDdb+a3S2PBiJFIdsv jQ4MV8qD2FM/IYbtH9dZLLpG7dKEKO1GaAdHUYCN7sA6kuNn+dQHh+iBioddaVq6l7gx Jk+IdNpkrJOlshDGN0yM74sOClr3YUbnAu2OCN8KgG0jp2MVZ324il4fdLF5J11Ibz6L 4JMR0KSgzm8CnQCYhEqeB/FoHuTOg7y4JlqfTVSiYDQ0exmi94Pe167/ZYud1p96bRwJ N9xretwXTdg1YOg+Vw1BvuBm6L5EFYoHGE+YKhyiowgBl3Do9un4eclnq4na4SqD6V4K N+XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MB1OfkHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n27-20020a056a000d5b00b0050e0530cfe4si13260615pfv.279.2022.07.12.08.00.58; Tue, 12 Jul 2022 08:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MB1OfkHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbiGLOwP (ORCPT + 99 others); Tue, 12 Jul 2022 10:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233769AbiGLOwK (ORCPT ); Tue, 12 Jul 2022 10:52:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77A4BA398; Tue, 12 Jul 2022 07:52:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AB9BAB819A6; Tue, 12 Jul 2022 14:52:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21205C3411C; Tue, 12 Jul 2022 14:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657637524; bh=DTpoBX/qQ/7h9wGaIdApkgpJtMwxfpNExs/uY3HT+eM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MB1OfkHD4K3eXCbdYcA4zOtML5Ik3INgUnlWF6A6yimNWxN8YJXWsf0Or3V464FrL rieNoAyJ4sLNu4fT5t8PjdQVUbvv2uMk1z5nMt6CPFbFlLYUpWL4W0ofTCiWfhZj4n CC8szZrMuWSTUdW4Q+T87txQGI2KhjHEy/2eCgNoRvvERxowUzPpnSFn5iFet/uksp 91SzKlHOmK4EYq5cSxULoAs21x3llm2EsTrYs2iVCd4QpJVelHIuInHrDMnOqhDnt7 4yR9KJVfxhrURarcAuv8yfApXW/bdfdV2v8jV01MsiJahMB6CSx8QN0FaUnYZbvsaR EcUkGVlQCHxQQ== Date: Tue, 12 Jul 2022 15:52:01 +0100 From: Filipe Manana To: bingjingc Cc: josef@toxicpanda.com, dsterba@suse.com, clm@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, robbieko@synology.com, bxxxjxxg@gmail.com Subject: Re: [PATCH v2 0/2] btrfs: send: fix sending link commands for existing file paths Message-ID: <20220712145201.GA1074561@falcondesktop> References: <20220712013632.7042-1-bingjingc@synology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220712013632.7042-1-bingjingc@synology.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022 at 09:36:30AM +0800, bingjingc wrote: > From: BingJing Chang > > There is a bug sending link commands for existing file paths. When we're > processing an inode, we go over all references. All the new file paths are > added to the "new_refs" list. And all the deleted file paths are added to > the "deleted_refs" list. In the end, when we finish processing the inode, > we iterate over all the items in the "new_refs" list and send link commands > for those file paths. After that, we go over all the items in the > "deleted_refs" list and send unlink commands for them. If there are > duplicated file paths in both lists, we will try to create them before we > remove them. Then the receiver gets an -EEXIST error when trying the link > operations. > > BingJing Chang (2): > btrfs: send: introduce recorded_ref_alloc and recorded_ref_free > btrfs: send: fix sending link commands for existing file paths > > fs/btrfs/send.c | 195 ++++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 181 insertions(+), 14 deletions(-) Looks good now, thanks. Reviewed-by: Filipe Manana Also, are you planning on submitting a test case for fstests too? > > -- > 2.37.0 >