Bug 19890 - Locking auf xfs-Dateisystem (wahrscheinlich) fehlerhaft
Summary: Locking auf xfs-Dateisystem (wahrscheinlich) fehlerhaft
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Samba
Version: UCS 2.4
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 2.4-1
Assignee: Stefan Gohmann
QA Contact: Tim Petersen
URL:
Keywords:
Depends on:
Blocks: 20693
  Show dependency treegraph
 
Reported: 2010-09-08 13:32 CEST by Jan Christoph Ebersbach
Modified: 2018-01-19 13:17 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:
walkenhorst: Patch_Available+


Attachments
master.try-other-methods-if-utimensat-is-not-supported-ret.patch (1.08 KB, patch)
2010-11-17 17:28 CET, Janek Walkenhorst
Details | Diff
v3-5.try-other-methods-if-utimensat-is-not-supported-ret.patch (1.84 KB, patch)
2010-11-17 17:28 CET, Janek Walkenhorst
Details | Diff
0001-try-other-methods-if-utimensat-is-not-supported-ret.patch (2.76 KB, patch)
2010-11-19 09:40 CET, Janek Walkenhorst
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Christoph Ebersbach univentionstaff 2010-09-08 13:32:56 CEST
Eingesetzte Samba-Version: 3.5.4

Beim Update eines Kundensystems ist aufgefallen, dass auf Samba-Dateifreigaben von Microsoft Office aus (getestet mit Excel) nicht ordentlich gespeichert werden kann. Der Benutzer erhält die Meldung, dass nicht ausreichend Speicherplatz auf dem Dateisystem zur Verfügung steht. Mit dem Programm smbclient habe ich auf der Kommandozeile folgende Meldungen beim Hochladen einer Datei erhalten:

smb: \tests\> put ps.txt postup.sh
NT_STATUS_NOT_SUPPORTED closing remote file \tests\postup.sh

Testweise habe ich auf dem XFS-Dateisystem eine Datei mit einem EXT3-Dateisystem angelegt und darauf ein Share platziert. Dort kam beim Hochladen die übliche Meldung, dass die Datei erfolgreich gespeichert wurde.
Comment 1 Tobias Scherer univentionstaff 2010-09-13 10:12:10 CEST
Auch berichtet an Ticket#: 2010091310011679
Comment 2 Stefan Gohmann univentionstaff 2010-09-13 13:57:39 CEST
Welcher Kernel wurde eingesetzt? 2.6.18 oder 2.6.32?
Comment 3 Jan Christoph Ebersbach univentionstaff 2010-09-13 14:03:47 CEST
Eingesetzte Kernel-Version: 2.6.18
Comment 4 Stefan Gohmann univentionstaff 2010-11-12 13:52:52 CET
root@samba-38-1:~# uname -a
Linux samba-38-1 2.6.18-ucs155-686 #1 SMP Wed May 19 16:40:34 UTC 2010 i686 GNU/Linux
root@samba-38-1:~# smbclient -U Administrator \\\\samba-38-1\\Administrator
Enter Administrator's password: 
Domain=[TEST] OS=[Unix] Server=[Samba 3.5.4]
smb: \> put x.txt
NT_STATUS_NOT_SUPPORTED closing remote file \x.txt
smb: \> 

root@samba-38-1:~# uname -a
Linux samba-38-1 2.6.32-ucs11-686-bigmem #1 SMP Fri Jul 30 17:54:39 UTC 2010 i686 GNU/Linux
root@samba-38-1:~# smbclient -U Administrator \\\\samba-38-1\\Administrator
Enter Administrator's password: 
Domain=[TEST] OS=[Unix] Server=[Samba 3.5.4]
smb: \> put x.txt
putting file x.txt as \x.txt (1,7 kb/s) (average 1,7 kb/s)
smb: \>

Das bedeutet mit Kernel 2.6.32 funktioniert es wieder.
Comment 5 Stefan Gohmann univentionstaff 2010-11-17 07:15:58 CET
Nach dem Downgrade auf Samba 3.3.10 funktioniert der Upload.
Comment 6 Stefan Gohmann univentionstaff 2010-11-17 11:09:14 CET
Das scheint das hier zu sein:
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515941

Aus dem Samba strace:
utimensat(AT_FDCWD, "x.txt", {{1289981751, 766721000}, {1289988416, 729565000}}, 0) = -1 ENOSYS (Function not implemented) <0.000026>

Upstream Mail-Thread:
http://lists.samba.org/archive/samba-technical/2010-November/074607.html
Comment 7 Moritz Muehlenhoff univentionstaff 2010-11-17 16:03:59 CET
utimensat() wurde in 2.6.22 als Syscall eingeführt und steht nicht zur Verfügung wenn der 2.6.18-Kernel verwendet wird. Solange Samba auf einem System übersetzt wurde, auf dem Kernel und glibc mit 2.6.32 übersetzt wurden, wird von Samba trotzdem versucht utimensat() zu verwenden.

Samba sollte statt einer Prüfung zur Compile-Zeit idealerweile eine Laufzeitprüfung implementieren; wenn ein Dummyaufruf von utimensat() ENOSYS zurückliefert, ist das dem aktuellen Samba-System utimensat() nicht verfügbar und der alternative Codepfad (über futimens() oder was auch immer) kann verwendet werden.
Comment 8 Janek Walkenhorst univentionstaff 2010-11-17 17:28:20 CET
Created attachment 2833 [details]
master.try-other-methods-if-utimensat-is-not-supported-ret.patch
Comment 9 Janek Walkenhorst univentionstaff 2010-11-17 17:28:38 CET
Created attachment 2834 [details]
v3-5.try-other-methods-if-utimensat-is-not-supported-ret.patch
Comment 10 Janek Walkenhorst univentionstaff 2010-11-17 17:29:51 CET
I have attached the patch:
 master.try-other-methods-if-utimensat-is-not-supported-ret.patch

If utimensat returns ENOSYS the other utime-methods are used instead.
Should apply cleanly to the v3-5-*, v3-6-*, and master branches.

This fixes the issue.


Also attached is the patch:
 v3-5.try-other-methods-if-utimensat-is-not-supported-ret.patch

This is the same change plus an analogous change for the function copy_reg().
Should apply cleanly to the v3-5-* branches.
Comment 11 Janek Walkenhorst univentionstaff 2010-11-19 09:40:13 CET
Created attachment 2838 [details]
0001-try-other-methods-if-utimensat-is-not-supported-ret.patch

> > but doing that correct would be a bit tricky. In
> > vfswrap_fs_capabilities() we also need to know that utimensat() doesn't
> > work to initialize p_ts_res correctly. A test utimensat() call would
> > actually be required to set p_ts_res right, too. POSIX does not even
> > mention that this call may fail with ENOSYS.
> >
> > I would prefer that people with utimensat resulting in ENOSYS should get
> > a big warning in the log files: "never us a glibc which is much more
> > recent than your kernel." This is a well known problem of Debian systems
> > with a way too old XEN kernel. Old kernels with new glibc are not
> > supported by their maintainers. People should just not do this - the lack
> > of utimensat() is just the most obvious place of brokenness, I guess
> > there are more, more subtle brokennesses waiting to be discovered.
>
> You are right, the results are not known if the kernel is too old for the
> glibc. Janek will create a new patch which adds the warning and he will
> also check vfswrap_fs_capabilities. I think this would be the best.
This is the patch with the check in vfswrap_fs_capabilities and a log message 
added.
Comment 12 Stefan Gohmann univentionstaff 2010-11-19 13:33:13 CET
Der Patch von Janek ist eingebaut, allerdings kommt die Warnung erst ab Debug Level 3.
Comment 13 Tim Petersen univentionstaff 2010-11-22 11:07:30 CET
(In reply to comment #12)
> Der Patch von Janek ist eingebaut, allerdings kommt die Warnung erst ab Debug
> Level 3.

In 2.4-1 funktioniert das Speichern mit 2.6.18 wieder in Verbindung mit einem XFS Dateisystem und samba 3.5.4.
Getestet mit Windows XP SP3 in Verbindung mit Office2007 und smbclient.

Folgende Meldung in der Log (bei debuglevel 3):

[2010/11/22 11:00:44.851447,  3] modules/vfs_default.c:146(vfswrap_fs_capabilities)
  vfswrap_fs_capabilities: utimensat returns ENOSYS. never us a glibc which is much more recent than your kernel.

Changelogeintrag ist vorhanden - verified
Comment 14 Sönke Schwardt-Krummrich univentionstaff 2010-12-10 16:37:19 CET
UCS 2.4-1 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden:
"Clone This Bug".