下面我包含了该命令的一个桁架,我尝试了各种 rm 方法,但每种方法都会得到相同的输出: 注意:这是在 isilon NAS 集群上运行的(他们的技术支持也被难住了。)
Cluster-1# rm -f "478.ts"
rm: 478.ts: Invalid argument
Cluster-1# truss -a rm 478.ts
mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366148608 (0x80061d000)
issetugid(0x80081da80,0x7fffffffefd8,0x40,0x0,0xffff80080081eaa8,0x0) = 0 (0x0)
lstat("/etc",{ mode=drwxr-xr-x ,inode=93955,size=3072,blksize=16384 }) = 0 (0x0)
lstat("/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=102839,size=47,blksize=16384 }) = 0 (0x0)
open("/etc/libmap.conf",O_CLOEXEC,01760) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=102839,size=47,blksize=16384 }) = 0 (0x0)
mmap(0x0,47,PROT_READ,MAP_PRIVATE,3,0x0) = 34366181376 (0x800625000)
close(3) = 0 (0x0)
lstat("/usr",{ mode=drwxr-xr-x ,inode=23492,size=512,blksize=16384 }) = 0 (0x0)
lstat("/usr/local",{ mode=drwxr-xr-x ,inode=23507,size=512,blksize=16384 }) = 0 (0x0)
lstat("/usr/local/etc",{ mode=drwxr-xr-x ,inode=23846,size=1024,blksize=16384 }) = 0 (0x0)
lstat("/usr/local/etc/libmap.d",{ mode=drwxr-xr-x ,inode=24971,size=512,blksize=16384 }) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) = 3 (0x3)
__sysctl(0x7fffffffc0d8,0x2,0x80081e6bc,0x7fffffffc0d0,0x0,0x0) = 0 (0x0)
fstatfs(0x3,0x7fffffffc118,0x80081e6bc,0x7fffffffc0d0,0x0,0x0) = 0 (0x0)
mmap(0x0,36864,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366185472 (0x800626000)
getdirentries(0x3,0x800623000,0x1000,0x800622028,0x0,0x0) = 80 (0x50)
lstat("/usr",{ mode=drwxr-xr-x ,inode=23492,size=512,blksize=16384 }) = 0 (0x0)
lstat("/usr/local",{ mode=drwxr-xr-x ,inode=23507,size=512,blksize=16384 }) = 0 (0x0)
lstat("/usr/local/etc",{ mode=drwxr-xr-x ,inode=23846,size=1024,blksize=16384 }) = 0 (0x0)
lstat("/usr/local/etc/libmap.d",{ mode=drwxr-xr-x ,inode=24971,size=512,blksize=16384 }) = 0 (0x0)
lstat("/usr/local/etc/libmap.d/mft.conf",{ mode=-rw-r--r-- ,inode=25013,size=50,blksize=16384 }) = 0 (0x0)
open("/usr/local/etc/libmap.d/mft.conf",O_CLOEXEC,0165) = 4 (0x4)
fstat(4,{ mode=-rw-r--r-- ,inode=25013,size=50,blksize=16384 }) = 0 (0x0)
mmap(0x0,50,PROT_READ,MAP_PRIVATE,4,0x0) = 34366222336 (0x80062f000)
close(4) = 0 (0x0)
munmap(0x80062f000,50) = 0 (0x0)
getdirentries(0x3,0x800623000,0x1000,0x800622028,0x50,0x8080808080808080) = 0 (0x0)
close(3) = 0 (0x0)
munmap(0x800625000,47) = 0 (0x0)
open("/var/run/ld-elf.so.hints",O_CLOEXEC,0162) = 3 (0x3)
read(3,"Ehnt\^A\0\0\0\M^@\0\0\0m\0\0\0\0"...,128) = 128 (0x80)
lseek(3,0x80,SEEK_SET) = 128 (0x80)
read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,109) = 109 (0x6d)
close(3) = 0 (0x0)
access("/lib/libc.so.7",0) = 0 (0x0)
open("/lib/libc.so.7",O_CLOEXEC,030503770) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=103356,size=1721078,blksize=16384 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366181376 (0x800625000)
mmap(0x0,3821568,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34368253952 (0x80081f000)
mmap(0x80081f000,1507328,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34368253952 (0x80081f000)
mmap(0x800b8e000,49152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x16f000) = 34371854336 (0x800b8e000)
mmap(0x800b9a000,172032,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34371903488 (0x800b9a000)
munmap(0x800625000,4096) = 0 (0x0)
close(3) = 0 (0x0)
munmap(0x800629000,24576) = 0 (0x0)
mmap(0x0,102400,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366197760 (0x800629000)
sysarch(0x81,0x7fffffffd0a8,0x4,0x0,0xffffffffffaac5e0,0xf0000000) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
readlink("/etc/malloc.conf",0x7fffffffc7d0,1024) ERR#2 'No such file or directory'
issetugid(0x80096477e,0x7fffffffc7d0,0xffffffffffffff00,0x2,0x40,0xffffffff0fffffff) = 0 (0x0)
mmap(0x0,262144,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366300160 (0x800642000)
munmap(0x800642000,262144) = 0 (0x0)
mmap(0x0,520192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366300160 (0x800642000)
munmap(0x800642000,253952) = 0 (0x0)
munmap(0x8006c0000,4096) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
geteuid() = 0 (0x0)
sigaction(SIGINFO,{ 0x402280 SA_RESTART ss_t },{ SIG_DFL SA_RESTART ss_t }) = 0 (0x0)
ioctl(0,TIOCGETA,0xffffd970) = 0 (0x0)
lstat("478.ts",{ mode=-rwxrwxrwx ,inode=57420697287,size=0,blksize=8192 }) = 0 (0x0)
access("478.ts",2) = 0 (0x0)
unlink("478.ts") ERR#22 'Invalid argument'
rm: write(2,"rm: ",4) = 4 (0x4)
478.tswrite(2,"478.ts",6) = 6 (0x6)
: write(2,": ",2) = 2 (0x2)
mmap(0x0,262144,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366816256 (0x8006c0000)
stat("/usr/share/nls/C/libc.cat",0x7fffffffd290) ERR#2 'No such file or directory'
stat("/usr/share/nls/libc/C",0x7fffffffd290) ERR#2 'No such file or directory'
stat("/usr/local/share/nls/C/libc.cat",0x7fffffffd290) ERR#2 'No such file or directory'
stat("/usr/local/share/nls/libc/C",0x7fffffffd290) ERR#2 'No such file or directory'
madvise(0x8006c1000,0x1000,0x5,0xaaaaaaaaaaaaaaab,0x8006c0030,0x800bc2c40) = 0 (0x0)
madvise(0x8006c2000,0x1000,0x5,0xaaaaaaaaaaaaaaab,0x7fffffffc790,0x800bc2c40) = 0 (0x0)
Invalid argument
write(2,"Invalid argument\n",17) = 17 (0x11)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
process exit, rval = 1
Cluster-1#```
答案1
“无效论点”可能来自perror
,报告错误号 EINVAL通过设置unlink
。
根据手册页、 EINVAL 只能与 一起出现unlinkat
,不能与 一起出现unlink
,并且 truss 输出显示unlink
调用,因此这种情况似乎不可能。然而我们就在这里。
我找到了一些其他报告当底层文件系统无法处理文件名的编码时,实用程序报告“无效参数”。
这对你来说可能不是问题,因为你的文件名似乎只是简单的 ASCII 字符,但我怀疑这里 EINVAL 也是由文件系统特定的代码调用的unlink
,所以这取决于你所在的文件系统使用。在 Isilon NAS 群集上,这可能是统一文件系统,除非它位于奇怪的位置(如 tmpfs 或 FUSE 安装),或位于可移动媒体上。
如果是这种情况,您可能需要让 Isilon 的实际工程师深入研究代码,找出可能导致取消链接时出现 EINVAL 的原因。