Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3979136pxb; Fri, 11 Feb 2022 12:05:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDCq1aWqF5EIIOMd24E2IeC+eChsYm62CVdjDxnmLHj32wzYcprUdsnIb+TxMIGv9xfo2F X-Received: by 2002:a05:6a00:793:: with SMTP id g19mr3334381pfu.21.1644609941412; Fri, 11 Feb 2022 12:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644609941; cv=none; d=google.com; s=arc-20160816; b=C0LoSquBwxTnrfxSwy8FynTrCkUCI0eRQryvG4WA13x+Xast6/Vc1yXxr8EABHOeRn 9Pitw1Uprt2g3veghc2w+T8hiYm0DxfOIBD9fjuS+PhXPr/pJZNJlC/hvlfrlevQOSyU kS8plw/4JcOn+8hnV6OZK112bypMc5LwvgxWyAtuPAMWHXFGzwMck/DThsVjicknzNT6 r3CcdxL+AOrwXke3d8KZo5a6LTn1+9xTBesxK6NZPXsQE7Hh7Zewiu3rMDnBozCUpRZw sDkac2bkOa3/cYDiuHIJDXT5/qc1h5p8mFCZOm5OK5PqW68zcjMuREXtdbG1cYcWGkdN I9pw== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=s0s8oigbYFmeEsqH7funi05O8we+5khTDz1fSxdMrPg=; b=Wog+cr4xoJvSV4JIDTR46KNQGVuqu2EnlWbqnZj9uprmL4nFNXFM4VG356lJDJ+RsD S5qkQXGG/qgV84M849AW6F558MQQJo8d/O9Ovg51bhBZLaI27YvEuEEouJoNq9JBAiJz hbF/h+Gi/0ueeIYbhG2qpvzE1Pz6wKBfXT2PuHb3hl23Xd9c8YiyyuVA3ifX07f/Djps fwFc6XM8xuZNLe/l9oIPzg0fEHrXdweRoYZ3w3F6wxXGMtMkE0M56+wbzq9C3D5AxVQp fYf9w+k9bEJQrtFzDu27pW6ilBDMk1tVIZqrQ4JbvHPLroB7MEq5QQRQg+WwXbG2zYK+ vxUA== 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:20 as permitted sender) smtp.mailfrom=linux-nfs-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 v12si5044162pjs.165.2022.02.11.12.05.15; Fri, 11 Feb 2022 12:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242753AbiBKKzr (ORCPT + 99 others); Fri, 11 Feb 2022 05:55:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239612AbiBKKzp (ORCPT ); Fri, 11 Feb 2022 05:55:45 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E7AD8D for ; Fri, 11 Feb 2022 02:55:43 -0800 (PST) Received: from [192.168.0.2] (ip5f5aebe1.dynamic.kabel-deutschland.de [95.90.235.225]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id EB81161EA1926; Fri, 11 Feb 2022 11:55:40 +0100 (CET) Message-ID: <82dffa3e-1b14-e590-aaf6-f9f8570e616c@molgen.mpg.de> Date: Fri, 11 Feb 2022 11:55:40 +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 From: Paul Menzel To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, it+linux-nfs@molgen.mpg.de, Anna Schumaker , regressions@lists.linux.dev References: <20220208183823.1391397-1-trondmy@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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-nfs@vger.kernel.org #regzbot monitor: https://lore.kernel.org/linux-nfs/20220208183823.1391397-1-trondmy@kernel.org/ Dear Trond, Am 09.02.22 um 23:02 schrieb Paul Menzel: > 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 Also for regzbot: Link: https://lore.kernel.org/linux-nfs/0235e04a-18aa-ccbf-f520-38a2d55e8b54@molgen.mpg.de/ 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)) {