linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [regression]: CIFS: block in wait_for_free_credits when open file for SMB1.0
       [not found] <359361880.3486881.1555294820885.JavaMail.zimbra@redhat.com>
@ 2019-04-15  2:30 ` Xiaoli Feng
  2019-04-17 13:49   ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoli Feng @ 2019-04-15  2:30 UTC (permalink / raw)
  To: CIFS

Hi,

Setup samba server on v5.1-rc3 and mount it in local with vers=1.0. Use the reproducer below to test if open file succesffully after unlink.
The process blocked in wait_for_free_credits and never return. SMB2.0+ don't have this issue because of

  https://bugzilla.kernel.org/show_bug.cgi?id=203271

It's a regression issue. Testing pass on v4.9-rc8 but start failed after v5.0.

[<0>] wait_for_free_credits+0x258/0x460 [cifs]
[<0>] SendReceive+0xcd/0x360 [cifs]
[<0>] CIFSPOSIXCreate+0x1bf/0x440 [cifs]
[<0>] cifs_posix_open+0x1ee/0x300 [cifs]
[<0>] cifs_do_create+0x447/0x710 [cifs]
[<0>] cifs_atomic_open+0x1ab/0x530 [cifs]
[<0>] path_openat+0xd54/0x1670
[<0>] do_filp_open+0x93/0x100
[<0>] do_sys_open+0x186/0x220
[<0>] do_syscall_64+0x55/0x1a0
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[<0>] 0xffffffffffffffff

reproducer.c:
#define _GNU_SOURCE            
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/file.h>
#include <errno.h>
void test()
{
    int fd;
    int ret;

    fd = open("./testfile",O_RDWR|O_CREAT,0644);
    printf("errno=%d\n",errno);
    if (fd < 0)
    {
        perror("open failed");
        exit(1);
    }
    ret = unlink("./testfile");
    if (ret < 0)
    {
        perror("unlink failed");
        exit(1);
    }
    //add close(fd) here, then does not block.
}
int main(int argc, char **argv)
{
    int index=50;
    while(index)
    {
        index--;
        printf("loop %d\n",index);
        test();
    }
    return 0;
}


I reported it in https://bugzilla.kernel.org/show_bug.cgi?id=203269

-- 
Best regards!
XiaoLi Feng 冯小丽

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom

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

* Re: [regression]: CIFS: block in wait_for_free_credits when open file for SMB1.0
  2019-04-15  2:30 ` [regression]: CIFS: block in wait_for_free_credits when open file for SMB1.0 Xiaoli Feng
@ 2019-04-17 13:49   ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2019-04-17 13:49 UTC (permalink / raw)
  To: Xiaoli Feng; +Cc: CIFS

Ronnie's patch fixed this and I have merged into cifs-2.6.git for-next
and added cc:stable

On Sun, Apr 14, 2019 at 9:31 PM Xiaoli Feng <xifeng@redhat.com> wrote:
>
> Hi,
>
> Setup samba server on v5.1-rc3 and mount it in local with vers=1.0. Use the reproducer below to test if open file succesffully after unlink.
> The process blocked in wait_for_free_credits and never return. SMB2.0+ don't have this issue because of
>
>   https://bugzilla.kernel.org/show_bug.cgi?id=203271
>
> It's a regression issue. Testing pass on v4.9-rc8 but start failed after v5.0.
>
> [<0>] wait_for_free_credits+0x258/0x460 [cifs]
> [<0>] SendReceive+0xcd/0x360 [cifs]
> [<0>] CIFSPOSIXCreate+0x1bf/0x440 [cifs]
> [<0>] cifs_posix_open+0x1ee/0x300 [cifs]
> [<0>] cifs_do_create+0x447/0x710 [cifs]
> [<0>] cifs_atomic_open+0x1ab/0x530 [cifs]
> [<0>] path_openat+0xd54/0x1670
> [<0>] do_filp_open+0x93/0x100
> [<0>] do_sys_open+0x186/0x220
> [<0>] do_syscall_64+0x55/0x1a0
> [<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> [<0>] 0xffffffffffffffff
>
> reproducer.c:
> #define _GNU_SOURCE
> #include <fcntl.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <sys/file.h>
> #include <errno.h>
> void test()
> {
>     int fd;
>     int ret;
>
>     fd = open("./testfile",O_RDWR|O_CREAT,0644);
>     printf("errno=%d\n",errno);
>     if (fd < 0)
>     {
>         perror("open failed");
>         exit(1);
>     }
>     ret = unlink("./testfile");
>     if (ret < 0)
>     {
>         perror("unlink failed");
>         exit(1);
>     }
>     //add close(fd) here, then does not block.
> }
> int main(int argc, char **argv)
> {
>     int index=50;
>     while(index)
>     {
>         index--;
>         printf("loop %d\n",index);
>         test();
>     }
>     return 0;
> }
>
>
> I reported it in https://bugzilla.kernel.org/show_bug.cgi?id=203269
>
> --
> Best regards!
> XiaoLi Feng 冯小丽
>
> Red Hat Software (Beijing) Co.,Ltd
> filesystem-qe Team
> IRC:xifeng,#channel: fs-qe
> Tel:+86-10-8388112
> 9/F, Raycom



-- 
Thanks,

Steve

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

end of thread, other threads:[~2019-04-17 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <359361880.3486881.1555294820885.JavaMail.zimbra@redhat.com>
2019-04-15  2:30 ` [regression]: CIFS: block in wait_for_free_credits when open file for SMB1.0 Xiaoli Feng
2019-04-17 13:49   ` Steve French

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