Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] smb: client: skip cifs_lookup on mkdir
@ 2025-09-09 20:27 Henrique Carvalho
  2025-09-10 17:50 ` Steve French
  0 siblings, 1 reply; 7+ messages in thread
From: Henrique Carvalho @ 2025-09-09 20:27 UTC (permalink / raw)
  To: smfrench; +Cc: ematsumiya, linux-cifs, Henrique Carvalho

For mkdir the final component is looked up with LOOKUP_CREATE |
LOOKUP_EXCL.

We don't need an existence check in mkdir; return NULL and let mkdir
create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
---
 fs/smb/client/dir.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index 5223edf6d11a..d26a14ba6d9b 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 	void *page;
 	int retry_count = 0;
 
+	/* if in mkdir, let create path handle it */
+	if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
+		return NULL;
+
 	xid = get_xid();
 
 	cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
-- 
2.50.1


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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-09 20:27 [PATCH] smb: client: skip cifs_lookup on mkdir Henrique Carvalho
@ 2025-09-10 17:50 ` Steve French
  2025-09-10 20:28   ` Steve French
  0 siblings, 1 reply; 7+ messages in thread
From: Steve French @ 2025-09-10 17:50 UTC (permalink / raw)
  To: Henrique Carvalho; +Cc: ematsumiya, linux-cifs

Interesting that running with three of your patches, I no longer see
the failure in generic/637 (dir lease related file contents bug) but I
do see two unexpected failures in generic/005 and generic/586:

http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/builds/116

e.g.

generic/005 5s ... - output mismatch (see
/data/xfstests-dev/results//smb21/generic/005.out.bad)
    --- tests/generic/005.out 2024-05-15 02:56:10.033955659 -0500
    +++ /data/xfstests-dev/results//smb21/generic/005.out.bad
2025-09-10 08:33:45.271123450 -0500
    @@ -1,8 +1,51 @@
     QA output created by 005
    +ln: failed to create symbolic link 'symlink_00': No such file or directory
    +ln: failed to create symbolic link 'symlink_01': No such file or directory
    +ln: failed to create symbolic link 'symlink_02': No such file or directory
    +ln: failed to create symbolic link 'symlink_03': No such file or directory
    +ln: failed to create symbolic link 'symlink_04': No such file or directory
    +ln: failed to create symbolic link 'symlink_05': No such file or directory

Do you also see these test failures?

On Tue, Sep 9, 2025 at 3:30 PM Henrique Carvalho
<henrique.carvalho@suse.com> wrote:
>
> For mkdir the final component is looked up with LOOKUP_CREATE |
> LOOKUP_EXCL.
>
> We don't need an existence check in mkdir; return NULL and let mkdir
> create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).
>
> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
> ---
>  fs/smb/client/dir.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
> index 5223edf6d11a..d26a14ba6d9b 100644
> --- a/fs/smb/client/dir.c
> +++ b/fs/smb/client/dir.c
> @@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
>         void *page;
>         int retry_count = 0;
>
> +       /* if in mkdir, let create path handle it */
> +       if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
> +               return NULL;
> +
>         xid = get_xid();
>
>         cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
> --
> 2.50.1
>


-- 
Thanks,

Steve

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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-10 17:50 ` Steve French
@ 2025-09-10 20:28   ` Steve French
  2025-09-10 21:09     ` Henrique Carvalho
  0 siblings, 1 reply; 7+ messages in thread
From: Steve French @ 2025-09-10 20:28 UTC (permalink / raw)
  To: Henrique Carvalho; +Cc: ematsumiya, linux-cifs

Henrique, I can repro the failure in generic/005 with your patches,
but am fascinated that one of your patches may have worked around the
generic/637 problem at least in some cases, but am having difficulty
bisecting this.

On Wed, Sep 10, 2025 at 12:50 PM Steve French <smfrench@gmail.com> wrote:
>
> Interesting that running with three of your patches, I no longer see
> the failure in generic/637 (dir lease related file contents bug) but I
> do see two unexpected failures in generic/005 and generic/586:
>
> http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/builds/116
>
> e.g.
>
> generic/005 5s ... - output mismatch (see
> /data/xfstests-dev/results//smb21/generic/005.out.bad)
>     --- tests/generic/005.out 2024-05-15 02:56:10.033955659 -0500
>     +++ /data/xfstests-dev/results//smb21/generic/005.out.bad
> 2025-09-10 08:33:45.271123450 -0500
>     @@ -1,8 +1,51 @@
>      QA output created by 005
>     +ln: failed to create symbolic link 'symlink_00': No such file or directory
>     +ln: failed to create symbolic link 'symlink_01': No such file or directory
>     +ln: failed to create symbolic link 'symlink_02': No such file or directory
>     +ln: failed to create symbolic link 'symlink_03': No such file or directory
>     +ln: failed to create symbolic link 'symlink_04': No such file or directory
>     +ln: failed to create symbolic link 'symlink_05': No such file or directory
>
> Do you also see these test failures?
>
> On Tue, Sep 9, 2025 at 3:30 PM Henrique Carvalho
> <henrique.carvalho@suse.com> wrote:
> >
> > For mkdir the final component is looked up with LOOKUP_CREATE |
> > LOOKUP_EXCL.
> >
> > We don't need an existence check in mkdir; return NULL and let mkdir
> > create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).
> >
> > Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
> > ---
> >  fs/smb/client/dir.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
> > index 5223edf6d11a..d26a14ba6d9b 100644
> > --- a/fs/smb/client/dir.c
> > +++ b/fs/smb/client/dir.c
> > @@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
> >         void *page;
> >         int retry_count = 0;
> >
> > +       /* if in mkdir, let create path handle it */
> > +       if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
> > +               return NULL;
> > +
> >         xid = get_xid();
> >
> >         cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
> > --
> > 2.50.1
> >
>
>
> --
> Thanks,
>
> Steve



-- 
Thanks,

Steve

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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-10 20:28   ` Steve French
@ 2025-09-10 21:09     ` Henrique Carvalho
  2025-09-11 13:55       ` Stefan Metzmacher
  0 siblings, 1 reply; 7+ messages in thread
From: Henrique Carvalho @ 2025-09-10 21:09 UTC (permalink / raw)
  To: Steve French; +Cc: ematsumiya, linux-cifs

Hi Steve,

On 9/10/25 5:28 PM, Steve French wrote:
> Henrique, I can repro the failure in generic/005 with your patches,
> but am fascinated that one of your patches may have worked around the
> generic/637 problem at least in some cases, but am having difficulty
> bisecting this.

I had not seen the failures in generic/005, but I also had not tested
with smb 2.1.

I will run more tests and dig into both generic/637 and the other
failing cases.

I will get back to you once I have something more concrete.

> 
> On Wed, Sep 10, 2025 at 12:50 PM Steve French <smfrench@gmail.com> wrote:
>>
>> Interesting that running with three of your patches, I no longer see
>> the failure in generic/637 (dir lease related file contents bug) but I
>> do see two unexpected failures in generic/005 and generic/586:
>>
>> http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/builds/116
>>
>> e.g.
>>
>> generic/005 5s ... - output mismatch (see
>> /data/xfstests-dev/results//smb21/generic/005.out.bad)
>>     --- tests/generic/005.out 2024-05-15 02:56:10.033955659 -0500
>>     +++ /data/xfstests-dev/results//smb21/generic/005.out.bad
>> 2025-09-10 08:33:45.271123450 -0500
>>     @@ -1,8 +1,51 @@
>>      QA output created by 005
>>     +ln: failed to create symbolic link 'symlink_00': No such file or directory
>>     +ln: failed to create symbolic link 'symlink_01': No such file or directory
>>     +ln: failed to create symbolic link 'symlink_02': No such file or directory
>>     +ln: failed to create symbolic link 'symlink_03': No such file or directory
>>     +ln: failed to create symbolic link 'symlink_04': No such file or directory
>>     +ln: failed to create symbolic link 'symlink_05': No such file or directory
>>
>> Do you also see these test failures?
>>
>> On Tue, Sep 9, 2025 at 3:30 PM Henrique Carvalho
>> <henrique.carvalho@suse.com> wrote:
>>>
>>> For mkdir the final component is looked up with LOOKUP_CREATE |
>>> LOOKUP_EXCL.
>>>
>>> We don't need an existence check in mkdir; return NULL and let mkdir
>>> create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).
>>>
>>> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
>>> ---
>>>  fs/smb/client/dir.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
>>> index 5223edf6d11a..d26a14ba6d9b 100644
>>> --- a/fs/smb/client/dir.c
>>> +++ b/fs/smb/client/dir.c
>>> @@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
>>>         void *page;
>>>         int retry_count = 0;
>>>
>>> +       /* if in mkdir, let create path handle it */
>>> +       if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
>>> +               return NULL;
>>> +
>>>         xid = get_xid();
>>>
>>>         cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
>>> --
>>> 2.50.1
>>>
>>
>>
>> --
>> Thanks,
>>
>> Steve
> 
> 
> 

-- 
Henrique
SUSE Labs

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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-10 21:09     ` Henrique Carvalho
@ 2025-09-11 13:55       ` Stefan Metzmacher
  2025-09-12  2:54         ` Steve French
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Metzmacher @ 2025-09-11 13:55 UTC (permalink / raw)
  To: Henrique Carvalho, Steve French; +Cc: ematsumiya, linux-cifs

Hi Henrique,

I'm also seeing problems with generic/005, before failing
it hangs a long time here:

root@ub1704-166:~# ps axuf | grep D
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         917  0.0  0.1  53408  3328 ?        Ssl  15:33   0:00 /usr/sbin/gssproxy -D
root        1037  0.0  0.2  10888  7508 ?        Ss   15:33   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
root       11704  0.0  0.0   2824  1636 pts/1    D+   15:49   0:00  |           |           \_ touch symlink_self
root       11720  0.0  0.0   9784  2564 pts/3    S+   15:50   0:00      \_ grep --color=auto D
root@ub1704-166:~# cat /proc/11704/stack
[<0>] wait_for_response+0x195/0x250 [cifs]
[<0>] compound_send_recv+0xb9d/0x2ac0 [cifs]
[<0>] cifs_send_recv+0x22/0x40 [cifs]
[<0>] SMB2_open+0x352/0x17b0 [cifs]
[<0>] smb3_query_mf_symlink+0x1c0/0x3a0 [cifs]
[<0>] check_mf_symlink+0x281/0x7a0 [cifs]
[<0>] cifs_get_fattr+0xc5f/0x21b0 [cifs]
[<0>] cifs_get_inode_info+0xad/0x460 [cifs]
[<0>] cifs_do_create.isra.0+0xe4c/0x2250 [cifs]
[<0>] cifs_atomic_open+0x4f5/0x1120 [cifs]
[<0>] path_openat+0x244e/0x47a0
[<0>] do_filp_open+0x1e3/0x440
[<0>] do_sys_openat2+0x100/0x190
[<0>] __x64_sys_openat+0x127/0x220
[<0>] x64_sys_call+0x1bce/0x2680
[<0>] do_syscall_64+0x7e/0x960
[<0>] entry_SYSCALL_64_after_hwframe+0x76/0x7e

I'm using these mount options
-ousername=root,password=test,noperm,vers=3.1.1,mfsymlinks,actimeo=0

I hope this helps tracking it down.

metze

Am 10.09.25 um 23:09 schrieb Henrique Carvalho:
> Hi Steve,
> 
> On 9/10/25 5:28 PM, Steve French wrote:
>> Henrique, I can repro the failure in generic/005 with your patches,
>> but am fascinated that one of your patches may have worked around the
>> generic/637 problem at least in some cases, but am having difficulty
>> bisecting this.
> 
> I had not seen the failures in generic/005, but I also had not tested
> with smb 2.1.
> 
> I will run more tests and dig into both generic/637 and the other
> failing cases.
> 
> I will get back to you once I have something more concrete.
> 
>>
>> On Wed, Sep 10, 2025 at 12:50 PM Steve French <smfrench@gmail.com> wrote:
>>>
>>> Interesting that running with three of your patches, I no longer see
>>> the failure in generic/637 (dir lease related file contents bug) but I
>>> do see two unexpected failures in generic/005 and generic/586:
>>>
>>> http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/builds/116
>>>
>>> e.g.
>>>
>>> generic/005 5s ... - output mismatch (see
>>> /data/xfstests-dev/results//smb21/generic/005.out.bad)
>>>      --- tests/generic/005.out 2024-05-15 02:56:10.033955659 -0500
>>>      +++ /data/xfstests-dev/results//smb21/generic/005.out.bad
>>> 2025-09-10 08:33:45.271123450 -0500
>>>      @@ -1,8 +1,51 @@
>>>       QA output created by 005
>>>      +ln: failed to create symbolic link 'symlink_00': No such file or directory
>>>      +ln: failed to create symbolic link 'symlink_01': No such file or directory
>>>      +ln: failed to create symbolic link 'symlink_02': No such file or directory
>>>      +ln: failed to create symbolic link 'symlink_03': No such file or directory
>>>      +ln: failed to create symbolic link 'symlink_04': No such file or directory
>>>      +ln: failed to create symbolic link 'symlink_05': No such file or directory
>>>
>>> Do you also see these test failures?
>>>
>>> On Tue, Sep 9, 2025 at 3:30 PM Henrique Carvalho
>>> <henrique.carvalho@suse.com> wrote:
>>>>
>>>> For mkdir the final component is looked up with LOOKUP_CREATE |
>>>> LOOKUP_EXCL.
>>>>
>>>> We don't need an existence check in mkdir; return NULL and let mkdir
>>>> create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).
>>>>
>>>> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
>>>> ---
>>>>   fs/smb/client/dir.c | 4 ++++
>>>>   1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
>>>> index 5223edf6d11a..d26a14ba6d9b 100644
>>>> --- a/fs/smb/client/dir.c
>>>> +++ b/fs/smb/client/dir.c
>>>> @@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
>>>>          void *page;
>>>>          int retry_count = 0;
>>>>
>>>> +       /* if in mkdir, let create path handle it */
>>>> +       if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
>>>> +               return NULL;
>>>> +
>>>>          xid = get_xid();
>>>>
>>>>          cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
>>>> --
>>>> 2.50.1
>>>>
>>>
>>>
>>> --
>>> Thanks,
>>>
>>> Steve
>>
>>
>>
> 


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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-11 13:55       ` Stefan Metzmacher
@ 2025-09-12  2:54         ` Steve French
  2025-09-12 12:29           ` Henrique Carvalho
  0 siblings, 1 reply; 7+ messages in thread
From: Steve French @ 2025-09-12  2:54 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: Henrique Carvalho, ematsumiya, linux-cifs, Bharath SM

I have confirmed that it is patch:  "smb: client: skip cifs_lookup on
mkdir" which causes the generic/005 failure (and also an umount leak?
that causes rmmod cifs to fail) but interestingly this patch does seem
like the one that "fixes" (or at least works around) the generic/637
(incorrect directory contents with dir leases and new file created)
failure.

Let me know if updated version of this patch to test.

On Thu, Sep 11, 2025 at 8:55 AM Stefan Metzmacher <metze@samba.org> wrote:
>
> Hi Henrique,
>
> I'm also seeing problems with generic/005, before failing
> it hangs a long time here:
>
> root@ub1704-166:~# ps axuf | grep D
> USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> root         917  0.0  0.1  53408  3328 ?        Ssl  15:33   0:00 /usr/sbin/gssproxy -D
> root        1037  0.0  0.2  10888  7508 ?        Ss   15:33   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
> root       11704  0.0  0.0   2824  1636 pts/1    D+   15:49   0:00  |           |           \_ touch symlink_self
> root       11720  0.0  0.0   9784  2564 pts/3    S+   15:50   0:00      \_ grep --color=auto D
> root@ub1704-166:~# cat /proc/11704/stack
> [<0>] wait_for_response+0x195/0x250 [cifs]
> [<0>] compound_send_recv+0xb9d/0x2ac0 [cifs]
> [<0>] cifs_send_recv+0x22/0x40 [cifs]
> [<0>] SMB2_open+0x352/0x17b0 [cifs]
> [<0>] smb3_query_mf_symlink+0x1c0/0x3a0 [cifs]
> [<0>] check_mf_symlink+0x281/0x7a0 [cifs]
> [<0>] cifs_get_fattr+0xc5f/0x21b0 [cifs]
> [<0>] cifs_get_inode_info+0xad/0x460 [cifs]
> [<0>] cifs_do_create.isra.0+0xe4c/0x2250 [cifs]
> [<0>] cifs_atomic_open+0x4f5/0x1120 [cifs]
> [<0>] path_openat+0x244e/0x47a0
> [<0>] do_filp_open+0x1e3/0x440
> [<0>] do_sys_openat2+0x100/0x190
> [<0>] __x64_sys_openat+0x127/0x220
> [<0>] x64_sys_call+0x1bce/0x2680
> [<0>] do_syscall_64+0x7e/0x960
> [<0>] entry_SYSCALL_64_after_hwframe+0x76/0x7e
>
> I'm using these mount options
> -ousername=root,password=test,noperm,vers=3.1.1,mfsymlinks,actimeo=0
>
> I hope this helps tracking it down.
>
> metze
>
> Am 10.09.25 um 23:09 schrieb Henrique Carvalho:
> > Hi Steve,
> >
> > On 9/10/25 5:28 PM, Steve French wrote:
> >> Henrique, I can repro the failure in generic/005 with your patches,
> >> but am fascinated that one of your patches may have worked around the
> >> generic/637 problem at least in some cases, but am having difficulty
> >> bisecting this.
> >
> > I had not seen the failures in generic/005, but I also had not tested
> > with smb 2.1.
> >
> > I will run more tests and dig into both generic/637 and the other
> > failing cases.
> >
> > I will get back to you once I have something more concrete.
> >
> >>
> >> On Wed, Sep 10, 2025 at 12:50 PM Steve French <smfrench@gmail.com> wrote:
> >>>
> >>> Interesting that running with three of your patches, I no longer see
> >>> the failure in generic/637 (dir lease related file contents bug) but I
> >>> do see two unexpected failures in generic/005 and generic/586:
> >>>
> >>> http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/builds/116
> >>>
> >>> e.g.
> >>>
> >>> generic/005 5s ... - output mismatch (see
> >>> /data/xfstests-dev/results//smb21/generic/005.out.bad)
> >>>      --- tests/generic/005.out 2024-05-15 02:56:10.033955659 -0500
> >>>      +++ /data/xfstests-dev/results//smb21/generic/005.out.bad
> >>> 2025-09-10 08:33:45.271123450 -0500
> >>>      @@ -1,8 +1,51 @@
> >>>       QA output created by 005
> >>>      +ln: failed to create symbolic link 'symlink_00': No such file or directory
> >>>      +ln: failed to create symbolic link 'symlink_01': No such file or directory
> >>>      +ln: failed to create symbolic link 'symlink_02': No such file or directory
> >>>      +ln: failed to create symbolic link 'symlink_03': No such file or directory
> >>>      +ln: failed to create symbolic link 'symlink_04': No such file or directory
> >>>      +ln: failed to create symbolic link 'symlink_05': No such file or directory
> >>>
> >>> Do you also see these test failures?
> >>>
> >>> On Tue, Sep 9, 2025 at 3:30 PM Henrique Carvalho
> >>> <henrique.carvalho@suse.com> wrote:
> >>>>
> >>>> For mkdir the final component is looked up with LOOKUP_CREATE |
> >>>> LOOKUP_EXCL.
> >>>>
> >>>> We don't need an existence check in mkdir; return NULL and let mkdir
> >>>> create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).
> >>>>
> >>>> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
> >>>> ---
> >>>>   fs/smb/client/dir.c | 4 ++++
> >>>>   1 file changed, 4 insertions(+)
> >>>>
> >>>> diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
> >>>> index 5223edf6d11a..d26a14ba6d9b 100644
> >>>> --- a/fs/smb/client/dir.c
> >>>> +++ b/fs/smb/client/dir.c
> >>>> @@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
> >>>>          void *page;
> >>>>          int retry_count = 0;
> >>>>
> >>>> +       /* if in mkdir, let create path handle it */
> >>>> +       if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
> >>>> +               return NULL;
> >>>> +
> >>>>          xid = get_xid();
> >>>>
> >>>>          cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
> >>>> --
> >>>> 2.50.1
> >>>>
> >>>
> >>>
> >>> --
> >>> Thanks,
> >>>
> >>> Steve
> >>
> >>
> >>
> >
>


-- 
Thanks,

Steve

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

* Re: [PATCH] smb: client: skip cifs_lookup on mkdir
  2025-09-12  2:54         ` Steve French
@ 2025-09-12 12:29           ` Henrique Carvalho
  0 siblings, 0 replies; 7+ messages in thread
From: Henrique Carvalho @ 2025-09-12 12:29 UTC (permalink / raw)
  To: Steve French, Stefan Metzmacher; +Cc: ematsumiya, linux-cifs, Bharath SM

On 9/11/25 11:54 PM, Steve French wrote:
> I have confirmed that it is patch:  "smb: client: skip cifs_lookup on
> mkdir" which causes the generic/005 failure (and also an umount leak?
> that causes rmmod cifs to fail) but interestingly this patch does seem
> like the one that "fixes" (or at least works around) the generic/637
> (incorrect directory contents with dir leases and new file created)
> failure.
> 
> Let me know if updated version of this patch to test.
> 
> On Thu, Sep 11, 2025 at 8:55 AM Stefan Metzmacher <metze@samba.org> wrote:
>>
>> Hi Henrique,
>>
>> I'm also seeing problems with generic/005, before failing
>> it hangs a long time here:
>>
>> root@ub1704-166:~# ps axuf | grep D
>> USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
>> root         917  0.0  0.1  53408  3328 ?        Ssl  15:33   0:00 /usr/sbin/gssproxy -D
>> root        1037  0.0  0.2  10888  7508 ?        Ss   15:33   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
>> root       11704  0.0  0.0   2824  1636 pts/1    D+   15:49   0:00  |           |           \_ touch symlink_self
>> root       11720  0.0  0.0   9784  2564 pts/3    S+   15:50   0:00      \_ grep --color=auto D
>> root@ub1704-166:~# cat /proc/11704/stack
>> [<0>] wait_for_response+0x195/0x250 [cifs]
>> [<0>] compound_send_recv+0xb9d/0x2ac0 [cifs]
>> [<0>] cifs_send_recv+0x22/0x40 [cifs]
>> [<0>] SMB2_open+0x352/0x17b0 [cifs]
>> [<0>] smb3_query_mf_symlink+0x1c0/0x3a0 [cifs]
>> [<0>] check_mf_symlink+0x281/0x7a0 [cifs]
>> [<0>] cifs_get_fattr+0xc5f/0x21b0 [cifs]
>> [<0>] cifs_get_inode_info+0xad/0x460 [cifs]
>> [<0>] cifs_do_create.isra.0+0xe4c/0x2250 [cifs]
>> [<0>] cifs_atomic_open+0x4f5/0x1120 [cifs]
>> [<0>] path_openat+0x244e/0x47a0
>> [<0>] do_filp_open+0x1e3/0x440
>> [<0>] do_sys_openat2+0x100/0x190
>> [<0>] __x64_sys_openat+0x127/0x220
>> [<0>] x64_sys_call+0x1bce/0x2680
>> [<0>] do_syscall_64+0x7e/0x960
>> [<0>] entry_SYSCALL_64_after_hwframe+0x76/0x7e
>>
>> I'm using these mount options
>> -ousername=root,password=test,noperm,vers=3.1.1,mfsymlinks,actimeo=0
>>
>> I hope this helps tracking it down.
>>
>> metze

Thanks, metze and Steve,

Two notes from digging into this:

->lookup() does not seem to be able to distinguish mkdir vs symlink as
both arrive with the same flags. So the "skip cifs_lookup() on mkdir"
also affects symlink.

For most cases, this seems to work fine, but after `touch` on a
self-symlink the trace shows more creates than closes, leading to leaked
opens on the server. Does this make sense?

# cat /proc/fs/cifs/Stats | grep "Open files"
Open files: 4 total (local), 4 open on server

I'll rework the patch and post a v2 once I fix this.

-- 
Henrique
SUSE Labs

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

end of thread, other threads:[~2025-09-12 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 20:27 [PATCH] smb: client: skip cifs_lookup on mkdir Henrique Carvalho
2025-09-10 17:50 ` Steve French
2025-09-10 20:28   ` Steve French
2025-09-10 21:09     ` Henrique Carvalho
2025-09-11 13:55       ` Stefan Metzmacher
2025-09-12  2:54         ` Steve French
2025-09-12 12:29           ` Henrique Carvalho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox