Linux client sends unexpected FSCTL_GET_REPARSE_POINT for file stat when using SMB311 POSIX
Jean-François Roy
jf at devklog.net
Sat Oct 19 04:39:39 UTC 2024
Hello,
I’m new to the list, new to SMB, and new to Samba, so please forgive
misunderstandings and misconceptions.
I have been debugging a strange issue a home using a given server and share
and a variety of Linux clients (different kernels and user space). The
visible effect was issuing a stat command from a shell on a file in a
mounted share would either return “Operation not supported” or a directory
entry, depending on the client. This didn’t happen for all files, only
some, with no obvious pattern. This also specifically happens when using
SMB311 POSIX extensions. When omitting the posix mount flag, the operations
are different (of course) and the problem does not happen.
After reading some code and doing some packet captures, the issue boils
down to the Linux client issuing an erroneous (I believe) or unexpected
FSCTL_GET_REPARSE_POINT compound operation on what should be a totally
normal file in a normal directory tree. The server returns
STATUS_NOT_A_REPARSE_POINT (0xc0000275) which yields the visible errors.
I think for some reason cifs_open_data_reparse under smb311_posix_get_fattr is
returning true, but I don’t see why it would do that given the packets I
have captured. I have not traced or debugged the kernel client yet, so I
don’t have more information about that hypothesis.
I don’t know what is special about the specific files that are triggering
this fault. I have renamed one problematic file and the issue continued to
happen, so it’s not the specific file name file name length or total path
length. The file does not have any extended attributes.
I have shared representative packet captures and configurations on Google
Drive.
https://drive.google.com/drive/folders/1cyfc0WXCkXgpyzYv1oZ87ZyVqTL3r3dl
Some information about my setup:
- Samba smbd version 4.22.0pre1-UNKNOWN (using
quay.io/samba.org/samba-server:nightly at sha256:ff4b3a6ea834cdf4d9ac2d34105c6ac3d66cdb095b5c3434ceb4095fab41aecf).
This version has the patch for statfs under SMB311 POSIX connections.
- Samba running as a container on a Kubernetes cluster, bare metal.
Linux 6.11.1
- Share root is on a openzfs dataset.
- Client kernels I have tested: 6.11.1 (my own
build), 6.6.44-production+truenas
- All client kernels have `CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y`
- Mount command (POSIX): mount -t smb3 -o user=x,vers=3.1.1,posix
//server/share mountpoint
- Mount command (no POSIX): mount -t smb3 -o user=x,vers=3.1.1
//server/share mountpoint
I’m going to continue investigating (in particular setup QEMU to debug the
kernel client on the latest kernel RC), but I thought I’d share my findings
so far.
More information about the samba-technical
mailing list