while doing a backup of a directory that is mounted via SMB from a Windows Server 2016 I get the following warning for some files:
using parent snapshot 450441a7
scan [/mnt/restic/source/data]
[4:01] 94079 directories, 629167 files, 311.562 GiB
scanned 94079 directories, 629167 files in 4:01
e[2K
warning for /mnt/restic/source/data/FILE.PDF: Listxattr: xattr.List /mnt/restic/source/data/FILE.PDF : numerical result out of range
[…]
Should I care about this message or can I safely ignore it?
Error err/e1 is number 34, ERANGE in errno(3), which means that the supplied buffer (buf and dest in the code above) is too small to hold the result from the syscall. But that’s weird, because in https://github.com/pkg/xattr/blob/master/xattr_linux.go#L35 (buf := make([]byte, size)) the buffer is supposed to be sized equally to the expected result size.
I’d love to have it reproducable locally to inspect the values in the program at runtime, curious what the expected size and buffer size is…
Thanks to the Gophers in #go-nuts on freenode for helping me understand this!
Someone is looking into submitting a fix upstream in Samba. Until then/regardless restic probably need to make the buffer bufsize+1 bytes large as a workaround.
I am experiencing this on SMB1 I suppose as ‘man mount.cifs’ says that version 1.0 is the default:
vers=
SMB protocol version. Allowed values are:
· 1.0 - The classic CIFS/SMBv1 protocol. This is the default.
· 2.0 - The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release
version of Windows Vista spoke a slightly different dialect (2.000) that is not supported.
· 2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.
· 3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.
Note too that while this option governs the protocol version used, not all features of each version are available.
I just tested mounting the share with ‘vers=2.0’ and the warning disappears! Thank you so much for finding out, this was great work!
Also please please please don’t continue using a dialect that old. If you have an application/vendor that still holds on to it you can check at https://aka.ms/StillNeedsSmb1 if the application/vendor is listed and if they plan on upgrading - if not, Ned Pyle will gladly add them to the wall of shame.