Ralph Boehme
2024-Nov-28 09:53 UTC
[Samba] Random EINVAL when opening files with SMB3 POSIX extensions enabled
On 11/26/24 11:03 PM, Andrew Gunnerson via samba wrote:> I recently tried enabling SMB3 POSIX extensions as I'm only using Linux clients > and would like to make use of the standard unix permission bits. However, I'm > running into an issue where a simple `cat` fails with -EINVAL when opening the > file: > > openat(AT_FDCWD, "Shells.txt", O_RDONLY) = -1 EINVAL (Invalid argument) > > The weird thing is that it's intermittent. It'll fail with EINVAL many times in > a row and then suddenly work and then start failing again.can you grab a network trace when it happens? <https://wiki.samba.org/index.php/Capture_Packets#Tracing_SMB_traffic_of_a_specific_client> Beware that SMB3 POSIX Extensions are still under active development and I would recommend not using them in production right now because of bugs in Samba and cifs.ko. -slow -- SerNet Samba Team Lead https://sernet.de/ Samba Team Member https://samba.org/ SAMBA+ packages https://samba.plus/ -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20241128/84de99e0/OpenPGP_signature.sig>
Andrew Gunnerson
2024-Nov-28 20:46 UTC
[Samba] Random EINVAL when opening files with SMB3 POSIX extensions enabled
Thanks for the replies! On Thu, Nov 28, 2024, at 04:34, Rowland Penny via samba wrote:> I do not use the SMB3 Unix extensions, but perhaps you may not be > either, have you tried replacing 'server min protocol = SMB2' (which is > the default anyway) with 'server min protocol = SMB3' ?I took a packet capture and do see the the client making POSIX extension requests, like SMB2_FILE_POSIX_INFO. On Thu, Nov 28, 2024, at 04:53, Ralph Boehme wrote:> can you grab a network trace when it happens?Sure thing! I disabled SMB encryption first since it seemed to make the pcaps useless. 1. pcap when running `cat <file>`, which fails with EINVAL: https://files.pub.chiller3.com/issues/samba/posix_extensions/2024-11-28/posix_enabled_broken.pcap 2. pcap when running `ls $(dirname <file>); cat <file>`, which seems to temporarily (but consistently) allow the file to be opened for a short time: https://files.pub.chiller3.com/issues/samba/posix_extensions/2024-11-28/posix_enabled_working.pcap 3. pcap when running `cat <file>` with the extensions disabled, which always works: https://files.pub.chiller3.com/issues/samba/posix_extensions/2024-11-28/posix_disabled_working.pcap> Beware that SMB3 POSIX Extensions are still under active development and > I would recommend not using them in production right now because of bugs > in Samba and cifs.ko.That's good to know. In my case, I'm mostly playing around with things on my personal systems and don't care if anything breaks or data gets corrupted. Happy to help test things! -Andrew
Apparently Analagous Threads
- Random EINVAL when opening files with SMB3 POSIX extensions enabled
- Bug#760504: blktap-utils: Failing to call io_setup with EINVAL
- [PATCH] vhost: return EINVAL if iovecs size does not match the message size
- [PATCH] vhost: return EINVAL if iovecs size does not match the message size
- [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.