Already did..should've included it. It's not particularly revealing to me though (I've attached the trace). The syscall goes as:

renameat2(AT_FDCWD, "/home/john/mnt/sshfs/status-20180806", AT_FDCWD, "/home/john/mnt/sshfs/status-20180807", RENAME_NOREPLACE) = -1 ERANGE (Numerical result out of range)

Also, I've run some a quick 'n dirty code to simply do the rename syscall which gives the same result. But, if in this code I simply invoke glibc's  renameat() (which is renameat2() less the "flags" arg), I do not get any errors.  So perhaps the issue is related to the RENAME_NOREPLACE flag. In fact, with my test code, if I do the syscall renameat2 with flags = 0, then also no error.

Note that in my test cases the source and destinations are regular files and the destination does not exist. If the destination does exist, then I get a different error:

 mv  ~/mnt/sshfs/status-20180806 ~/mnt/sshfs/status-20180807
error: 17 File exists

which, of course, does not occur for "local" files.



Paul Eggert wrote:
John Stanley wrote:
I'm wondering if anyone intimately familiar with the SYS_renameat2 rework in coreutils-8.30 'mv' might have any ideas on how to pin this one done.

Sure, run this:

strace mv ~/mnt/sshfs/status-2018080{6,7}

and look at the strace output.

execve("/bin/mv", ["mv", "/home/john/mnt/sshfs/status-2018"..., 
"/home/john/mnt/sshfs/status-2018"...], 0x7fff4851ab20 /* 38 vars */) = 0
brk(NULL)                               = 0x41f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=167426, ...}) = 0
mmap(NULL, 167426, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa048621000
close(3)                                = 0
openat(AT_FDCWD, "/lib/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\34\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=40872, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa04861f000
mmap(NULL, 2126432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fa048417000
mprotect(0x7fa04841e000, 2093056, PROT_NONE) = 0
mmap(0x7fa04861d000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fa04861d000
close(3)                                = 0
openat(AT_FDCWD, "/lib/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\24\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=24968, ...}) = 0
mmap(NULL, 2113864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fa048212000
mprotect(0x7fa048216000, 2093056, PROT_NONE) = 0
mmap(0x7fa048415000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fa048415000
close(3)                                = 0
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000A\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18527904, ...}) = 0
mmap(NULL, 1825600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa048054000
mmap(0x7fa048076000, 1335296, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7fa048076000
mmap(0x7fa0481bc000, 311296, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 
0x168000) = 0x7fa0481bc000
mmap(0x7fa048208000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b3000) = 0x7fa048208000
mmap(0x7fa04820e000, 15168, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa04820e000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa048051000
arch_prctl(ARCH_SET_FS, 0x7fa048051740) = 0
mprotect(0x7fa048208000, 16384, PROT_READ) = 0
mprotect(0x7fa048415000, 4096, PROT_READ) = 0
mprotect(0x7fa04861d000, 4096, PROT_READ) = 0
mprotect(0x41d000, 4096, PROT_READ)     = 0
mprotect(0x7fa048670000, 4096, PROT_READ) = 0
munmap(0x7fa048621000, 167426)          = 0
brk(NULL)                               = 0x41f000
brk(0x440000)                           = 0x440000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=126975712, ...}) = 0
mmap(NULL, 126975712, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa040739000
close(3)                                = 0
geteuid()                               = 1001
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
renameat2(AT_FDCWD, "/home/john/mnt/sshfs/status-20180806", AT_FDCWD, 
"/home/john/mnt/sshfs/status-20180807", RENAME_NOREPLACE) = -1 ERANGE 
(Numerical result out of range)
stat("/home/john/mnt/sshfs/status-20180807", 0x7fffe61d63b0) = -1 ENOENT (No 
such file or directory)
lstat("/home/john/mnt/sshfs/status-20180806", {st_mode=S_IFREG|0644, st_size=0, 
...}) = 0
newfstatat(AT_FDCWD, "/home/john/mnt/sshfs/status-20180807", 0x7fffe61d60c0, 
AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2997, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) 
= -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 
-1 ENOENT (No such file or directory)
write(2, "mv: ", 4mv: )                     = 4
write(2, "cannot move '/home/john/mnt/sshf"..., 92cannot move 
'/home/john/mnt/sshfs/status-20180806' to 
'/home/john/mnt/sshfs/status-20180807') = 92
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) 
= -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) 
= -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = 
-1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = 
-1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
write(2, ": Numerical result out of range", 31: Numerical result out of range) 
= 31
write(2, "\n", 1
)                       = 1
lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Reply via email to