Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4669563iog; Wed, 22 Jun 2022 03:37:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tSXxKW+qrVXrfuv6lOp27vyAGjQv+V42b+zq54s/UFAcPS90kPmxMDiIIZqk1sN7B4JuHG X-Received: by 2002:a05:6402:24a4:b0:434:e43e:2462 with SMTP id q36-20020a05640224a400b00434e43e2462mr3305501eda.312.1655894229198; Wed, 22 Jun 2022 03:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655894229; cv=none; d=google.com; s=arc-20160816; b=SOSKRyrMZSK0K0T9zMRjpXOolh6EG7a8Ic42nNVrQZPWlZ5uekQen91UTJACqg0j0I bdzuScWlhpvCRmeT7nzISPmNNGC5q23zgr3slripQYQtgLSaptDYlZYdaRLxnjxTBAHH W+hc4ootP/LzUeiuR6CqWnMZn6XyOuEy7T2ZPN6F2eu3b24nOanz85h72Co8Xje1Pfe3 PaOBUMYWS7WBujHm4nwa7hwNbk08lNkjRlTHA0Q+izaT6OIN8kondrmQcreJuP7Z7Jo2 JDQONn9fmTHqkrHBGl5IH6hdGHhXg01QAwx4pYrNSgiA028pZYcpenlIjHtKSjc2vS7y wDcA== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=eBAMnDo2A2dyiL8GImJYSvjocj5z0gmHhJC/cQDizRc=; b=vFWLtMy83OWKpsbWLRnUfr66pc496os8LuOo2LckAt2BsQkyIO2MFFWsRJhLr2T3oz SR3Rk3j3WWKv+r6ElQtbRIa/rw46OuRbqaqEyq8ubPr6makLqjTlYXPTIZZ+2V2VNrZr 9jKudA23mmlQsRSqvhtwtv37ccMOZ1NeCnsPtMqYLPVVKYfHMVA59hl9cufrER5jOY5h QIX6rRVOSz4RDNScTgzTbz7pZW55DmTqV5BzvR1UdhOcmL3cfCBvbJwMBAVL4pElyiT3 ZS5Z+3wX2HmA+cQO+w4AhV+VuNhQZYF2Erl1z05TLduj+eL4z57s7tpFy+QLI7t+rJEs nc1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=uNxTxCK9; 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 gn18-20020a1709070d1200b006fec40443b6si4898058ejc.23.2022.06.22.03.36.42; Wed, 22 Jun 2022 03:37:09 -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=uNxTxCK9; 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 S1354590AbiFVKfK (ORCPT + 99 others); Wed, 22 Jun 2022 06:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239763AbiFVKfI (ORCPT ); Wed, 22 Jun 2022 06:35:08 -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 A11163B561; Wed, 22 Jun 2022 03:35:06 -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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eBAMnDo2A2dyiL8GImJYSvjocj5z0gmHhJC/cQDizRc=; b=uNxTxCK9boI3FpAQY3vXXazKK9 z7Jk3/i6calEzMlh8bsDkdIe12D98ixDCjL04eHemGCLut+piHi5NAUm73LLHTynYB1kn3vWqE2la QZOsKygKbOofTXUETehcn6JlIqHzalQAaRAjydAJ0QMk6Ms8Nx5tCtOFS4zkqnYdc89zZVrSAs3+J hdOqCNnCRUm4MGHpyaiAfvcWiUpNLdZjTWT82jW5L3TOPpkRmQUgo/LvJ1q/Tnyo6/IGLuqKrj4ss KIuFIYocRURF3keX6Gc/vXtBSxva7vbhdrDo1LkGrPoQhHbzYqMfP+48auWU6YyvEbINm3uwHuMlb LYqyI+wA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1o3xhL-003BUA-Gw; Wed, 22 Jun 2022 10:34:59 +0000 Date: Wed, 22 Jun 2022 11:34:59 +0100 From: Al Viro To: sunliming Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, sunliming@kylino.cn, kelulanainsley@gmail.com 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=us-ascii Content-Disposition: inline In-Reply-To: <20220622085146.444516-1-sunliming@kylinos.cn> 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 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().