Re: [PATCH] smb/client: fix nlink of an overwritten open file

Namjae Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <CAKYAXd8_Su3e-7UbF4gWVhWzRecXxZckRNGD9XcYEkt9GPaf=w@mail.gmail.com>
On Wed, Aug 5, 2026 at 8:44 AM Steve French <[email protected]> wrote:
>
> From: ChenXiaoSong <[email protected]>
>
> Reproducer:
>
>   1. server: systemctl start ksmbd
>   2. client: mount with `posix` option
>      mount -t cifs -o posix //${server_ip}/export /mnt
>   3. client: touch /mnt/file1 /mnt/file2
>   4. client: C program: int fd = open("/mnt/file2", O_RDONLY);
>   5. client: C program: rename("/mnt/file1", "/mnt/file2");
>   6. client: C program: struct stat stbuf; fstat(fd, &stbuf);
>                         stbuf.st_nlink is 1, should be 0
>
> This patch fixes xfstests generic/035 when mounted with `posix` option.
>
> Signed-off-by: ChenXiaoSong <[email protected]>
> Signed-off-by: Steve French <[email protected]>
Will apply it to #for-next.
Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.