Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5487387iog; Wed, 22 Jun 2022 22:03:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tpCAKiYoVLh61YtgsVJMTNwfSf7oFDvxKQ2Snp0/l2K4YOR0iK0g0JRGpE2ytgOhRgeYyR X-Received: by 2002:a05:6a00:ad0:b0:50a:51b3:1e3d with SMTP id c16-20020a056a000ad000b0050a51b31e3dmr39183573pfl.18.1655960598771; Wed, 22 Jun 2022 22:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655960598; cv=none; d=google.com; s=arc-20160816; b=gnLG8kMlNFqCZBX8N8y2rw8T1rsfS73YycdQmUFnVjAjB+P8ydbr+fhJDQgCL3HLAQ 01IoOFUZ7wj8cwVuu57FkXEs1hjHHNfo83aw1v5qkNnPK3m7+HlTMCwK4KN5Bv0f1DPL su7kNW/j+L/6SqrmjZIxM03vP12+/zHpR31I1v3wJKTpk8YpyS9j0R43Kj9i14Kwg+1k eDm9Gg69lzYGJbeFfaOz22oasaSs86JRj3kaYre7QqZlE0R521vOnrLdGdOU5vieB29h iAtNCfIjrgD8U3BQbmecWSXd2wiHYNC1HkENMDiQhKWUzyex2tSY5l74wnpDB2XJtoqF jtWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EDunuY7O5hAPgL1BhKSksPMMhIIfJXz8txcUJNIwT/A=; b=agdkj4R4C7V7HxHODNb3MbCaNxMLD3yYUqX6Xqy02QLdEHoyQHDxCxEcTiu1AuOxBe DZSy6b5cfgkTlWaaFfaorf5B4UbHRqmgXjPeKXA8IhH0Up5joRJHm3EHWH/Uk/LYcBNm g5MbFwRGBM0bxCVK15CEDh1XIAndh3VkfRHA5a9eZUajM35dRhBfRJ8dmfa2XFEQewPu icR/OnVLrTqFjPlCW12ESRP2R4h86OuHLqN+jpdA82CmKb6NmNNgyMH54xn6/MwpYgtc KLZwpTcRr0gOmtBFFrk4bpXuWc9J4RcjCEY5LC4U3gNBFk5PDe2nLE6yLMi9Q4HVv+LG vg9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=erkQTTzY; 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=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a170903018100b0016a336d1839si12023184plg.164.2022.06.22.22.03.06; Wed, 22 Jun 2022 22:03:18 -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=@linux.org.uk header.s=zeniv-20220401 header.b=erkQTTzY; 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=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232982AbiFWErR (ORCPT + 99 others); Thu, 23 Jun 2022 00:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243327AbiFWDst (ORCPT ); Wed, 22 Jun 2022 23:48:49 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F94E3DA6B; Wed, 22 Jun 2022 20:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=EDunuY7O5hAPgL1BhKSksPMMhIIfJXz8txcUJNIwT/A=; b=erkQTTzYczL6JKF7+aS3kheQC7 Am8cmBiVmdHnbXS/z2EOVm39y3Ovj+pKNOVC1RDpRA6lhMm5krp/v/VW5NK0rksnSYPjxDEwkHfQQ j3VYDgbmodwl5Z7t4S2qgItpkJAuBxg45OaEzhr0mqMrYJRk/iUDc3drmLccxCX/TugAVOf6QPgqs mNibyIKdPnWBH7Nla73/rgAhZA/bZAPQ2FiP5MNps4HYT1EM1m+EuF1p7rpG9Ig2U7r9tqwcdElLs 5fzbETCMmB6F1GGmgl0BkwtJXTAX7VSzAsLT/GaK4BOz1BoSou0wehHH4jDWMS0uqaQJR7LZT/9V1 ZCB4oGxA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1o4Dpk-003Pd1-W8; Thu, 23 Jun 2022 03:48:45 +0000 Date: Thu, 23 Jun 2022 04:48:44 +0100 From: Al Viro To: sunliming Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, sunliming@kylino.cn Subject: Re: [PATCH] walk_component(): get inode in lookup_slow branch statement block Message-ID: References: <20220622085146.444516-1-sunliming@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,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 Thu, Jun 23, 2022 at 11:44:29AM +0800, sunliming wrote: > Al Viro 于2022年6月22日周三 18:35写道: > > > > On Wed, Jun 22, 2022 at 04:51:46PM +0800, sunliming wrote: > > > The inode variable is used as a parameter by the step_into function, > > > but is not assigned a value in the sub-lookup_slow branch path. So > > > get the inode in the sub-lookup_slow branch path. > > > > Take a good look at handle_mounts() and the things it does when > > *not* in RCU mode (i.e. LOOKUP_RCU is not set). Specifically, > > *inode = d_backing_inode(path->dentry); > > *seqp = 0; /* out of RCU mode, so the value doesn't matter */ > > this part. > > > > IOW, the values passed to step_into() in inode/seq are overridden unless > > we stay in RCU mode. And if we'd been through lookup_slow(), we'd been > > out of RCU mode since before we called step_into(). > > It might be more appropriate and easier to understand to do this > before parameter passing in the top-level walk_component function? It's possible to fall out of RCU mode *inside* step_into(), so we need it done there anyway. Unfortunately ;-/