GNOME Bugzilla – Bug 792169
g_file_copy freezes on CIFS mount
Last modified: 2018-01-04 10:32:20 UTC
g_file_copy freezes sometimes when copying files within one CIFS mount. It doesn't happen everytime, but it seems it can be reproduced when "copying dir" with many files using "gio copy": mkdir CIFSMOUNT/BAR; for file in CIFSMOUNT/FOO/*; do gio copy -p "$file" CIFSMOUNT/BAR/${file##*/}; done It freezes with following trace:
+ Trace 238311
The proposed patch from Bug 791457 seemingly fixes this issue, but I would say that it rather reduces the chance of it... any idea what is wrong? This was initially wrongly reported in https://bugzilla.gnome.org/show_bug.cgi?id=784770#c4...
Actually, it seems that it fails on the same file every time and it is reproducible just with "gio copy" of that concrete file. If I do the following change: @@ -2868 +2868 @@ retry: - result = splice (fd_in, off_in, fd_out, off_out, len, SPLICE_F_MORE); + result = splice (fd_in, off_in, fd_out, off_out, len, SPLICE_F_NONBLOCK); ...it returns "Error splicing file: Resource temporarily unavailable" in the last iteration (off_in and off_out are equal to file size). I can't reproduce with the same file on ext4. So maybe something wrong in kernel CIFS module...?
If it’s freezing in the splice() syscall, then that sounds like a kernel FS driver problem, not a GLib problem. Similarly, if you can’t reproduce with ext4 (but the same code path is being taken in GLib), then that also points towards it being a kernel problem. I guess you’re probably still investigating this right now — but unless you find any evidence to the contrary, I’d be tempted to close this as NOTGNOME.
Created attachment 366251 [details] output of strace gio I can reproduce this bug on smb-shares. No problem with nfs. Only when copying multiple files. Always on the same file. $ strace -o output.txt gio copy * /home/sysop/foo/
I don't have any evidence that this is GLib problem, so probably let's close this as NOTGNOME, but I would say that this is quite serious and we have to be sure that this is going to be fixed. Steve, can you please report it to the following places: https://bugzilla.samba.org/buglist.cgi?component=kernel%20fs&list_id=14383&product=CifsVFS&resolution=--- and/or https://bugzilla.kernel.org/buglist.cgi?component=CIFS&product=File%20System&resolution=---
https://bugzilla.kernel.org/show_bug.cgi?id=198349