Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2327491rwa; Mon, 22 Aug 2022 06:07:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6J1vArmrgaJ9z7jR63RsOYvp3VWGfIvw6w0qhUgeoz+rYUqo55BnagNWlwMfiGUcUDc1Tt X-Received: by 2002:a17:903:124f:b0:171:4c36:a6bf with SMTP id u15-20020a170903124f00b001714c36a6bfmr20213633plh.0.1661173670709; Mon, 22 Aug 2022 06:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661173670; cv=none; d=google.com; s=arc-20160816; b=pihr5RF3JtpD0Ob2iMWjb3JI30taIwwqZZJaDUpYskJA8jHjeUcPPh4Z+CA1VE7Huf Kcy4LESKJUuv3tr2y8tcAn9sicWazA1k2itLK6a3W/RHHoEvjZnWdUxz7y95ASTIzTgr uZIZD+k5CZtPiJT7ieGw/cSWnsjTBKcmtNh9Euv4EfYvVKB9RI+pWThwyM2Od05iVDEe wrmQa+UDUdf8cXLxybYsA3sFya2kGDcILgCfCheetBmx1EtRJlF75Fdm0twQlfWFiblp 8ZSUvQ3amrdzGLvgmWLlxPf9QEUiwptdJgpDAXxCV7ZD/rB+y3cMw2yH28xUgrgfU2zx mK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=Kc5mGUgbC9e93/8VtvBmXTPzMo+Wf+Vj9kC1tsuV+5U=; b=RkKyX2yehzQmOQlE4mvT1uF+0qEq8J9Bl1EY1mPTNpkMDGG2GA5fDP2DmUPGgQAE/R URBsUOn9lq4bb3iuP3a3zp2nWh0MzEVZ+B0aXtXHkdVFLhfmtkMBufXgzToxU1rvlIXS aLQrlxdGDL4SaRXtzcyPwEHWF5XnDcOAh0Gi1k317uotrSEkXyhkT7h+HJWxSYZRwwpb mSns8xLniyfoz8NVzIYLcTiTuuKnl6T9bfCjCy36clvirDqWiW1zVN8D0sbjkyGKhTJq LeY26Yr3tD7p3wbbsjs2L+Bjj12q/v3zGKGRwTAnebbT7ptkJAAzD21xdOkzz/kZARZc R+xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=XQ0ngXOX; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a170902d4d200b0016ec63b2033si9733781plg.121.2022.08.22.06.07.38; Mon, 22 Aug 2022 06:07:50 -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=@suse.cz header.s=susede2_rsa header.b=XQ0ngXOX; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234918AbiHVMGb (ORCPT + 99 others); Mon, 22 Aug 2022 08:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234862AbiHVMG2 (ORCPT ); Mon, 22 Aug 2022 08:06:28 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD5839BB3; Mon, 22 Aug 2022 05:06:27 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AEB7E34537; Mon, 22 Aug 2022 12:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1661169986; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Kc5mGUgbC9e93/8VtvBmXTPzMo+Wf+Vj9kC1tsuV+5U=; b=XQ0ngXOXIn08K6CbVR0BrzxyQduDBpj+CyfEbs3m+0Y8unmyFlodAreccqTmNhd0frQPGE fR+2iHeigcnU9GerNJAsqPiB/ydhxgBYmYrzLD3vvG/MLNf6d4RLYMlXsC5XdmWhVPknIa 5WtkXpqHqjhFfon0+dAxat6VSOy0S/Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1661169986; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Kc5mGUgbC9e93/8VtvBmXTPzMo+Wf+Vj9kC1tsuV+5U=; b=Nqfem3JipBVmHs68SZ1NcjQM/iQ7oMz0tKwWT1VnDui74mlU3jXY+2tp7oC+GJV9XOheHn vNCoFIA+Cfjc5wCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6D40013523; Mon, 22 Aug 2022 12:06:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9DaLGUJxA2MpQAAAMHmgww (envelope-from ); Mon, 22 Aug 2022 12:06:26 +0000 Date: Mon, 22 Aug 2022 14:01:13 +0200 From: David Sterba To: bingjingc Cc: fdmanana@kernel.org, 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 v3 0/2] btrfs: send: fix failures when processing inodes with no links Message-ID: <20220822120112.GT13489@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, bingjingc , fdmanana@kernel.org, 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 References: <20220812144233.132960-1-bingjingc@synology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220812144233.132960-1-bingjingc@synology.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Fri, Aug 12, 2022 at 10:42:31PM +0800, bingjingc wrote: > From: BingJing Chang > > There is a bug causing send failures when processing an orphan directory > with no links. In commit 46b2f4590aab ("Btrfs: fix send failure when root > has deleted files still open")', the orphan inode issue was addressed. The > send operation fails with a ENOENT error because of any attempts to > generate a path for the inode with a link count of zero. Therefore, in that > patch, sctx->ignore_cur_inode was introduced to be set if the current inode > has a link count of zero for bypassing some unnecessary steps. And a helper > function btrfs_unlink_all_paths() was introduced and called to clean up old > paths found in the parent snapshot. However, not only regular files but > also directories can be orphan inodes. So if the send operation meets an > orphan directory, it will issue a wrong unlink command for that directory > now. Soon the receive operation fails with a EISDIR error. Besides, the > send operation also fails with a ENOENT error later when it tries to > generate a path of it. > > > BingJing Chang (2): > btrfs: send: refactor get_inode_info() > btrfs: send: fix failures when processing inodes with no links Added to misc-next, thanks.