linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks
@ 2022-05-06 16:03 Jonathan Cormier
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cormier @ 2022-05-06 16:03 UTC (permalink / raw)
  To: trondmy; +Cc: Anna.Schumaker, linux-nfs, pmenzel

Tested patch on ubuntu kernel 5.13.0-40. And it resolved a regression
we were seeing on our build servers.

Reported bug: https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1971482

Tested-by: Jonathan Cormier <jcormier@criticallink.com>

Thanks

-- Sending again in plain text mode...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks
  2022-02-11 10:55   ` Paul Menzel
@ 2022-02-11 11:40     ` Thorsten Leemhuis
  0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Leemhuis @ 2022-02-11 11:40 UTC (permalink / raw)
  To: Paul Menzel, Trond Myklebust
  Cc: linux-nfs, it+linux-nfs, Anna Schumaker, regressions

On 11.02.22 11:55, Paul Menzel wrote:
> #regzbot monitor:
> https://lore.kernel.org/linux-nfs/20220208183823.1391397-1-trondmy@kernel.org/

Thx for trying, but that failed (as is unneeded, see below): regzbot
can't determine which of the tracked regression might be meant here, so
it can't associate it with your report.

> Am 09.02.22 um 23:02 schrieb Paul Menzel:
> 
>> Am 08.02.22 um 19:38 schrieb trondmy@kernel.org:
>>> From: Trond Myklebust <trond.myklebust@hammerspace.com>
>>>
>>> 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 <pmenzel@molgen.mpg.de>
>>> Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a
>>> directory fails")
>>> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
>>
>> Thank you for fixing it so quickly. My colleague verified, that it
>> fixes our issue.
>>
>> Tested-by: Donald Buczek <buczek@molgen.mpg.de>
> 
> Also for regzbot:
> 
> Link:
> https://lore.kernel.org/linux-nfs/0235e04a-18aa-ccbf-f520-38a2d55e8b54@molgen.mpg.de/

Hmmm, regzbot from this could in theory be modified to determine which
regression was meant, but right now regzbot processes commands
sequentially, so in this order it wouldn't work anyway.

But there is a bigger problem: that link points to a reply to your
report, not the report. I guess I can modify regzbot to handle such
cases, but I have more pressing issue right now, sorry. But I'll keep it
in mind.

The right link tag one would have been:

Link:
https://lore.kernel.org/r/bd2075f0-2343-5bfa-83bf-0e916303727d@molgen.mpg.de/

(s!/r/!/linux-nfs/! would have worked for regzbot as well)

Trond, can you please add this tag to your patch in case you respin it,
as explained, as explained in
'Documentation/process/submitting-patches.rst' and
'Documentation/process/5.Posting.rst'.

BTW, paul: Regzbot will monitor every subthread with a proper link tag
(like I gave above), so there is no need for a "#regzbot monitor" in
anyway if developers would just place the tags as the documentation states.

Ciao, Thorsten


>>> ---
>>>   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)) {
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks
  2022-02-09 22:02 ` Paul Menzel
@ 2022-02-11 10:55   ` Paul Menzel
  2022-02-11 11:40     ` Thorsten Leemhuis
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Menzel @ 2022-02-11 10:55 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, it+linux-nfs, Anna Schumaker, regressions

#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 <trond.myklebust@hammerspace.com>
>>
>> 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 <pmenzel@molgen.mpg.de>
>> Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a 
>> directory fails")
>> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> Thank you for fixing it so quickly. My colleague verified, that it fixes 
> our issue.
> 
> Tested-by: Donald Buczek <buczek@molgen.mpg.de>

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)) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks
  2022-02-08 18:38 trondmy
@ 2022-02-09 22:02 ` Paul Menzel
  2022-02-11 10:55   ` Paul Menzel
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Menzel @ 2022-02-09 22:02 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, it+linux-nfs, Anna Schumaker

Dear Trond,


Am 08.02.22 um 19:38 schrieb trondmy@kernel.org:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> 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 <pmenzel@molgen.mpg.de>
> Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails")
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

Thank you for fixing it so quickly. My colleague verified, that it fixes 
our issue.

Tested-by: Donald Buczek <buczek@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)) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks
@ 2022-02-08 18:38 trondmy
  2022-02-09 22:02 ` Paul Menzel
  0 siblings, 1 reply; 5+ messages in thread
From: trondmy @ 2022-02-08 18:38 UTC (permalink / raw)
  To: Paul Menzel, Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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 <pmenzel@molgen.mpg.de>
Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 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)) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-06 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 16:03 [PATCH] NFS: LOOKUP_DIRECTORY is also ok with symlinks Jonathan Cormier
  -- strict thread matches above, loose matches on Subject: below --
2022-02-08 18:38 trondmy
2022-02-09 22:02 ` Paul Menzel
2022-02-11 10:55   ` Paul Menzel
2022-02-11 11:40     ` Thorsten Leemhuis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).