tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NFS issue with 10.0_BETA





On 27/02/23 23:18, Edgar Fuß wrote:
Any suggestions on how to identify the precise problem/fix?
What are the enclosing directory's permissions?

drwxrwxr-x 2 mark ecs 512 Feb 28 09:40 .

Can you strace the cp command?
Can you tcpdump the NFS traffic during the cp?

Below are three pairs of trace and tcpdump output
first is  linux to netbsd10 where it fails
then  linux to netbsd9 where it works
and netbsd10 to netbsd10 where it works

linux to netbsd10:

  [...]
geteuid()                               = 1002
openat(AT_FDCWD, "B", O_RDONLY|O_PATH|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
newfstatat(AT_FDCWD, "A", {st_mode=S_IFREG|0664, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "B", {st_mode=S_IFREG|0664, st_size=8, ...}, 0) = 0
openat(AT_FDCWD, "A", O_RDONLY)         = 3
newfstatat(3, "", {st_mode=S_IFREG|0664, st_size=6, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "B", O_WRONLY|O_TRUNC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=2998, ...}, AT_EMPTY_PATH) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2998
read(4, "", 4096)                       = 0
close(4)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_NZ.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_NZ.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_NZ/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, "cp: ", 4)                     = 4
write(2, "cannot create regular file 'B'", 30) = 30




 1 ->  V3 NULL Call (Reply In 2)
 2 <-  V3 NULL Reply (Call In 1)
 3 ->  V3 GETATTR Call (Reply In 4), FH: 0xb41e2121
 4 <-  V3 GETATTR Reply (Call in 3) Directory mode: 0775 uid: 1002 gid 1020
 6 ->  V3 GETATTR Call (Reply In 7), FH: 0xb7c814ef
7 <- V3 GETATTR Reply (Call in 6) Regular File mode: 0664 uid: 1002 gid 1020
 8 ->  V3 GETATTR Call (Reply In 9), FH: 0xf9f94117
9 <- V3 GETATTR Reply (Call in 8) Regular File mode: 0664 uid: 93 gid: 1020
10 ->  V3 GETATTR Call (Reply In 11), FH: 0xb7c814ef
11 <- V3 GETATTR Reply (Call in 10) Regular File mode: 0664 uid: 1002 gid 1020
12 ->  V3 ACCESS Call (Reply In 13), FH: 0xb7c814ef, [Check: RD MD XT XE]
13 <- V3 ACCESS Reply (Call In 12), [Access Denied: XE], [Allowed: RD MD XT]
14 ->  V3 GETATTR Call (Reply In 15), FH: 0xf9f94117
15 <- V3 GETATTR Reply (Call in 14) Regular File mode: 0664 uid: 93 gid: 1020
16 ->  V3 ACCESS Call (Reply In 17), FH: 0xf9f94117, [Check: RD MD XT XE]
17 <- V3 ACCESS Reply (Call In 16), [Access Denied: XE], [Allowed: RD MD XT]
18 ->  V3 SETATTR Call (Reply in 19), FH: 0xf9f94117
19 <-  V3 SETATTR Reply (Call In 18) Error: NFS3ERR_ACCESS



linux to netbsd9:


  [...]
geteuid()                               = 1002
openat(AT_FDCWD, "B", O_RDONLY|O_PATH|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
newfstatat(AT_FDCWD, "A", {st_mode=S_IFREG|0664, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "B", {st_mode=S_IFREG|0664, st_size=8, ...}, 0) = 0
openat(AT_FDCWD, "A", O_RDONLY)         = 3
newfstatat(3, "", {st_mode=S_IFREG|0664, st_size=6, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "B", O_WRONLY|O_TRUNC) = 4
ioctl(4, BTRFS_IOC_CLONE or FICLONE, 3) = -1 EOPNOTSUPP (Operation not supported)
newfstatat(4, "", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_EMPTY_PATH) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
copy_file_range(3, NULL, 4, NULL, 9223372035781033984, 0) = 6
copy_file_range(3, NULL, 4, NULL, 9223372035781033984, 0) = 0
close(4)                                = 0
close(3)                                = 0
lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++




 1 ->  V3 GETATTR Call (Reply In 2), FH: 0xaa31a955
 2 <-  V3 GETATTR Reply (Call in 1) Directory mode: 0775 uid: 1002 gid 1086
 4 ->  V3 GETATTR Call (Reply In 5), FH: 0x3ea62165
5 <- V3 GETATTR Reply (Call in 4) Regular File mode: 0664 uid: 1002 gid 1020
 6 ->  V3 GETATTR Call (Reply In 7), FH: 0xfe8a620f
7 <- V3 GETATTR Reply (Call in 6) Regular File mode: 0664 uid: 93 gid: 1020
 8 ->  V3 GETATTR Call (Reply In 9), FH: 0x3ea62165
9 <- V3 GETATTR Reply (Call in 8) Regular File mode: 0664 uid: 1002 gid 1020
10 ->  V3 ACCESS Call (Reply In 11), FH: 0x3ea62165, [Check: RD MD XT XE]
11 <- V3 ACCESS Reply (Call In 10), [Access Denied: XE], [Allowed: RD MD XT]
12 ->  V3 GETATTR Call (Reply In 13), FH: 0xfe8a620f
13 <- V3 GETATTR Reply (Call in 12) Regular File mode: 0664 uid: 93 gid: 1020
14 ->  V3 ACCESS Call (Reply In 15), FH: 0xfe8a620f, [Check: RD MD XT XE]
15 <- V3 ACCESS Reply (Call In 14), [Access Denied: XE], [Allowed: RD MD XT]
16 ->  V3 SETATTR Call (Reply in 17), FH: 0xfe8a620f
17 <-  V3 SETATTR Reply (Call In 16)
18 ->  V3 READ Call (Reply In 19), FH: 0x3ea62165 Offset: 0 Len: 4096
19 <-  V3 READ Reply (Call In 18) Len: 6
20 -> V3 WRITE Call (Reply In 21), FH: 0xfe8a620f Offset: 0 Len: 6 FILE_SYNC
21 <-  V3 WRITE Reply (Call In 20) Len: 6 FILE_SYNC





netbsd10 to netbsd10:


   [...]
 23167  23167 cp       CALL  getuid
 23167  23167 cp       RET   getuid 1002/0x3ea, 1002/0x3ea
 23167  23167 cp       CALL  umask(0)
 23167  23167 cp       RET   umask 18/0x12
 23167  23167 cp       CALL  umask(0x12)
 23167  23167 cp       RET   umask 0
23167 23167 cp CALL __sigaction_sigtramp(SIGINFO,0x7f7fff5bc750,0x7f7fff5bc770,0x719f4139c530,2)
 23167  23167 cp       RET   __sigaction_sigtramp 0
 23167  23167 cp       CALL  __stat50(0x18ea05290,0x7f7fff5bc7d0)
 23167  23167 cp       NAMI  "B"
 23167  23167 cp       RET   __stat50 0
23167 23167 cp CALL mmap(0,0x5000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
 23167  23167 cp       RET   mmap 124928814710784/0x719f419f8000
23167 23167 cp CALL mmap(0,0x1000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
 23167  23167 cp       RET   mmap 124928814706688/0x719f419f7000
23167 23167 cp CALL mmap(0,0x1000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
 23167  23167 cp       RET   mmap 124928814702592/0x719f419f6000
23167 23167 cp CALL mmap(0,0x1000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
 23167  23167 cp       RET   mmap 124928814698496/0x719f419f5000
23167 23167 cp CALL mmap(0,0x5000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
 23167  23167 cp       RET   mmap 124928814678016/0x719f419f0000
 23167  23167 cp       CALL  __stat50(0x719f419f01b0,0x719f419f01b8)
 23167  23167 cp       NAMI  "A"
 23167  23167 cp       RET   __stat50 0
 23167  23167 cp       CALL  __stat50(0x18ea05290,0x7f7fff5bc910)
 23167  23167 cp       NAMI  "B"
 23167  23167 cp       RET   __stat50 0
 23167  23167 cp       CALL  open(0x719f419f7000,0,0)
 23167  23167 cp       NAMI  "A"
 23167  23167 cp       RET   open 3
 23167  23167 cp       CALL  __stat50(0x18ea05290,0x7f7fff5bc6c0)
 23167  23167 cp       NAMI  "B"
 23167  23167 cp       RET   __stat50 0
 23167  23167 cp       CALL  open(0x18ea05290,0x401,0)
 23167  23167 cp       NAMI  "B"
 23167  23167 cp       RET   open 4
23167 23167 cp CALL mmap(0,6,PROT_READ,0x1<SHARED,FILE,ALIGN=NONE>,3,0,0)
 23167  23167 cp       RET   mmap 124928814673920/0x719f419ef000
 23167  23167 cp       CALL  madvise(0x719f419ef000,6,2)
 23167  23167 cp       RET   madvise 0
 23167  23167 cp       CALL  write(4,0x719f419ef000,6)
 23167  23167 cp       GIO   fd 4 wrote 6 bytes
       "hello\n"
 23167  23167 cp       RET   write 6
 23167  23167 cp       CALL  munmap(0x719f419ef000,6)
 23167  23167 cp       RET   munmap 0
 23167  23167 cp       CALL  close(3)
 23167  23167 cp       RET   close 0
 23167  23167 cp       CALL  close(4)
 23167  23167 cp       RET   close 0
 23167  23167 cp       CALL  _lwp_self
 23167  23167 cp       RET   _lwp_self 23167/0x5a7f
23167 23167 cp CALL __sigprocmask14(1,0x7f7fff5bc6b0,0x7f7fff5bc6f0)
 23167  23167 cp       RET   __sigprocmask14 0
 23167  23167 cp       CALL  __sigprocmask14(3,0x7f7fff5bc6f0,0)
 23167  23167 cp       RET   __sigprocmask14 0
 23167  23167 cp       CALL  _lwp_self
 23167  23167 cp       RET   _lwp_self 23167/0x5a7f
23167 23167 cp CALL __sigprocmask14(1,0x7f7fff5bc680,0x7f7fff5bc6f0)
 23167  23167 cp       RET   __sigprocmask14 0
 23167  23167 cp       CALL  __sigprocmask14(3,0x7f7fff5bc6f0,0)
 23167  23167 cp       RET   __sigprocmask14 0
 23167  23167 cp       CALL  exit(0)




 1 ->  V3 ACCESS Call (Reply In 2), FH: 0xb41e2121, [Check: LU]
 2 <-  V3 ACCESS Reply (Call In 1), [Allowed: LU]
 3 ->  V3 GETATTR Call (Reply In 4), FH: 0xf9f94117
4 <- V3 GETATTR Reply (Call in 3) Regular File mode: 0664 uid: 93 gid: 1020
 5 ->  V3 GETATTR Call (Reply In 6), FH: 0xb7c814ef
6 <- V3 GETATTR Reply (Call in 5) Regular File mode: 0664 uid: 1002 gid 1020
 7 ->  V3 ACCESS Call (Reply In 8), FH: 0xb7c814ef, [Check: RD]
 8 <-  V3 ACCESS Reply (Call In 7), [Allowed: RD]
 9 ->  V3 ACCESS Call (Reply In 10), FH: 0xf9f94117, [Check: MD XT]
10 <-  V3 ACCESS Reply (Call In 9), [Allowed: MD XT]
11 ->  V3 SETATTR Call (Reply in 12), FH: 0xf9f94117
12 <-  V3 SETATTR Reply (Call In 11)
13 ->  V3 READ Call (Reply In 14), FH: 0xb7c814ef Offset: 0 Len: 6
14 <-  V3 READ Reply (Call In 13) Len: 6
15 -> V3 WRITE Call (Reply In 16), FH: 0xf9f94117 Offset: 0 Len: 6 FILE_SYNC
16 <-  V3 WRITE Reply (Call In 15) Len: 6 FILE_SYNC




I have the full traces for all of these if anyone wants them.


cheers
mark


Home | Main Index | Thread Index | Old Index