Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2298920pxb; Wed, 9 Feb 2022 15:31:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy21GC49DRoeubD2X2uerADCLiUlkVrMXmoZr4Xx2JemkUkIm5BcIonqGGqWOgHFxxnYQM9 X-Received: by 2002:a17:903:40c6:: with SMTP id t6mr4573035pld.117.1644449519764; Wed, 09 Feb 2022 15:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449519; cv=none; d=google.com; s=arc-20160816; b=cnLOVfhRkBAEvb6zL2CkUi7jHAalU3jDSIWnQaxiem1w+ysMI7Vy6yTNrfMk0AWCpT BsaxbIKJyDc0CKj3irfRgh24gIlZ1w9eSo4W0nuYaUXiIQCiM2peJoVuKBoQYi3aLAZz EkYfHKIS8j7GmuXA7W15r/RwoOODq8b9Kovw75HDTi2Az5cbgk/yqyp+auuUVRimF3Wl IvkPkypGW+BmFaPRkPI1InO/Cb6S7zN9UdK64YdqhxXRQTzCcqY3MtXyVmt+FaRsGCvV FOkYrKEWXVu+YgCLDrW4DKqGAmoNTV2RNJiboqgY5Irp3qzuS9ozEmod9BP6wl9XfRmZ xi/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=8FaNuv8PWYMlIEybSlDNd0lV+Oxb0bDZGIo8yG8bC8Y=; b=rvGNeTZTLYS2gfyO1ZPqkZrhQAHIg9l3P+E12Fju731wt28cbKRXt8I7ldwKF+uBSM lvx46/XUjPtmuKc++/i2lKIYJDrAA3yUKlEfIotqg4yYx/OWDA8PuLglTWlM4WZMzfQ/ OuZwqx3gYIoKhS3FHOhzSiRI6v3RNanmLM341Y0mGMoDBKFd1F4OBItQqVhU78z3i6uN vnlzHXIfei+q2MMWePgE+KvC/j+3iptcgC42HmUKjS1v0FvQuecXgN3kQ1wshn8X82Bt d9fjD2qdWPOntF7zCR4KDOe74b2ZT+uVkB5WI+/iZSs3kjPbE55iy5eBozaAESo6Qi3p tn+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i10si17739512pgt.437.2022.02.09.15.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:31:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59688E079C96; Wed, 9 Feb 2022 15:21:57 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234752AbiBIWCb (ORCPT + 99 others); Wed, 9 Feb 2022 17:02:31 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:45272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234798AbiBIWC3 (ORCPT ); Wed, 9 Feb 2022 17:02:29 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F103BE00ED7E for ; Wed, 9 Feb 2022 14:02:26 -0800 (PST) Received: from [192.168.0.2] (ip5f5aee0c.dynamic.kabel-deutschland.de [95.90.238.12]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id CE25861E6478B; Wed, 9 Feb 2022 23:02:23 +0100 (CET) Message-ID: Date: Wed, 9 Feb 2022 23:02:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks Content-Language: en-US To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, it+linux-nfs@molgen.mpg.de, Anna Schumaker References: <20220208183823.1391397-1-trondmy@kernel.org> From: Paul Menzel In-Reply-To: <20220208183823.1391397-1-trondmy@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-nfs@vger.kernel.org Dear Trond, Am 08.02.22 um 19:38 schrieb trondmy@kernel.org: > From: Trond Myklebust > > Commit ac795161c936 (NFSv4: Handle case where the lookup of a directory > fails) [1], part of Linux since 5.17-rc2, introduced a regression, where > a symbolic link on an NFS mount to a directory on another NFS does not > resolve(?) the first time it is accessed: > > Reported-by: Paul Menzel > Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails") > Signed-off-by: Trond Myklebust Thank you for fixing it so quickly. My colleague verified, that it fixes our issue. Tested-by: Donald Buczek Kind regards, Paul > --- > fs/nfs/dir.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c > index e128503728f2..6dee4e12d381 100644 > --- a/fs/nfs/dir.c > +++ b/fs/nfs/dir.c > @@ -2051,14 +2051,14 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, > if (!res) { > inode = d_inode(dentry); > if ((lookup_flags & LOOKUP_DIRECTORY) && inode && > - !S_ISDIR(inode->i_mode)) > + !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) > res = ERR_PTR(-ENOTDIR); > else if (inode && S_ISREG(inode->i_mode)) > res = ERR_PTR(-EOPENSTALE); > } else if (!IS_ERR(res)) { > inode = d_inode(res); > if ((lookup_flags & LOOKUP_DIRECTORY) && inode && > - !S_ISDIR(inode->i_mode)) { > + !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) { > dput(res); > res = ERR_PTR(-ENOTDIR); > } else if (inode && S_ISREG(inode->i_mode)) {