![`ls` 命令在 Azure 文件存储共享中的某个目录中无限期挂起](https://linux22.com/image/708316/%60ls%60%20%E5%91%BD%E4%BB%A4%E5%9C%A8%20Azure%20%E6%96%87%E4%BB%B6%E5%AD%98%E5%82%A8%E5%85%B1%E4%BA%AB%E4%B8%AD%E7%9A%84%E6%9F%90%E4%B8%AA%E7%9B%AE%E5%BD%95%E4%B8%AD%E6%97%A0%E9%99%90%E6%9C%9F%E6%8C%82%E8%B5%B7.png)
我在 Ubuntu 16.04 VM 中安装了 Azure 文件存储共享,如下所示本指南一切似乎都运行正常。因此,我运行了一些会产生大量数据的进程,例如每次运行 10k 个文件,将它们收集到每次运行的目录中,并移动已安装存储的目录。其中一些目录有点损坏,如果我ls
在它们上运行,命令会无限期挂起。有什么提示吗?提前致谢。
编辑正如 Andrew 在评论中所建议的,我运行了strace
该ls
命令,输出如下:
08:54:14.405929 execve("/bin/ls", ["ls"], [/* 29 vars */]) = 0
08:54:14.406240 brk(NULL) = 0x9b1000
08:54:14.406325 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.406422 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0a669d000
08:54:14.406487 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
08:54:14.406536 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
08:54:14.406593 fstat(3, {st_mode=S_IFREG|0644, st_size=35482, ...}) = 0
08:54:14.406652 mmap(NULL, 35482, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff0a6694000
08:54:14.406700 close(3) = 0
08:54:14.406766 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.406814 open("/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
08:54:14.406857 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260Z\0\0\0\0\0\0"..., 832) = 832
08:54:14.406898 fstat(3, {st_mode=S_IFREG|0644, st_size=130224, ...}) = 0
08:54:14.406944 mmap(NULL, 2234080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff0a6258000
08:54:14.406995 mprotect(0x7ff0a6277000, 2093056, PROT_NONE) = 0
08:54:14.407063 mmap(0x7ff0a6476000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e000) = 0x7ff0a6476000
08:54:14.407124 mmap(0x7ff0a6478000, 5856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff0a6478000
08:54:14.407182 close(3) = 0
08:54:14.407237 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.407280 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
08:54:14.407342 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
08:54:14.407392 fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
08:54:14.407437 mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff0a5e8e000
08:54:14.407503 mprotect(0x7ff0a604e000, 2097152, PROT_NONE) = 0
08:54:14.407547 mmap(0x7ff0a624e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7ff0a624e000
08:54:14.407593 mmap(0x7ff0a6254000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff0a6254000
08:54:14.407648 close(3) = 0
08:54:14.407704 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.407754 open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
08:54:14.407806 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\25\0\0\0\0\0\0"..., 832) = 832
08:54:14.407849 fstat(3, {st_mode=S_IFREG|0644, st_size=456632, ...}) = 0
08:54:14.407891 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0a6693000
08:54:14.407932 mmap(NULL, 2552072, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff0a5c1e000
08:54:14.407981 mprotect(0x7ff0a5c8c000, 2097152, PROT_NONE) = 0
08:54:14.408038 mmap(0x7ff0a5e8c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6e000) = 0x7ff0a5e8c000
08:54:14.408094 close(3) = 0
08:54:14.408144 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.408208 open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
08:54:14.408259 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\r\0\0\0\0\0\0"..., 832) = 832
08:54:14.408301 fstat(3, {st_mode=S_IFREG|0644, st_size=14608, ...}) = 0
08:54:14.408343 mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff0a5a1a000
08:54:14.408391 mprotect(0x7ff0a5a1d000, 2093056, PROT_NONE) = 0
08:54:14.408433 mmap(0x7ff0a5c1c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff0a5c1c000
08:54:14.408490 close(3) = 0
08:54:14.408537 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
08:54:14.408607 open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
08:54:14.408652 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260`\0\0\0\0\0\0"..., 832) = 832
08:54:14.408695 fstat(3, {st_mode=S_IFREG|0755, st_size=138696, ...}) = 0
08:54:14.408738 mmap(NULL, 2212904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff0a57fd000
08:54:14.408788 mprotect(0x7ff0a5815000, 2093056, PROT_NONE) = 0
08:54:14.408831 mmap(0x7ff0a5a14000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7ff0a5a14000
08:54:14.408882 mmap(0x7ff0a5a16000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff0a5a16000
08:54:14.408954 close(3) = 0
08:54:14.409008 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0a6692000
08:54:14.409091 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0a6690000
08:54:14.409152 arch_prctl(ARCH_SET_FS, 0x7ff0a6690800) = 0
08:54:14.409252 mprotect(0x7ff0a624e000, 16384, PROT_READ) = 0
08:54:14.409352 mprotect(0x7ff0a5a14000, 4096, PROT_READ) = 0
08:54:14.409409 mprotect(0x7ff0a5c1c000, 4096, PROT_READ) = 0
08:54:14.409490 mprotect(0x7ff0a5e8c000, 4096, PROT_READ) = 0
08:54:14.409574 mprotect(0x7ff0a6476000, 4096, PROT_READ) = 0
08:54:14.409630 mprotect(0x61d000, 4096, PROT_READ) = 0
08:54:14.409674 mprotect(0x7ff0a669f000, 4096, PROT_READ) = 0
08:54:14.409721 munmap(0x7ff0a6694000, 35482) = 0
08:54:14.409761 set_tid_address(0x7ff0a6690ad0) = 2107
08:54:14.409801 set_robust_list(0x7ff0a6690ae0, 24) = 0
08:54:14.409842 rt_sigaction(SIGRTMIN, {0x7ff0a5802b50, [], SA_RESTORER|SA_SIGINFO, 0x7ff0a580e390}, NULL, 8) = 0
08:54:14.409889 rt_sigaction(SIGRT_1, {0x7ff0a5802be0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7ff0a580e390}, NULL, 8) = 0
08:54:14.409930 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
08:54:14.409969 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
08:54:14.410106 statfs("/sys/fs/selinux", 0x7ffe99d30390) = -1 ENOENT (No such file or directory)
08:54:14.410209 statfs("/selinux", 0x7ffe99d30390) = -1 ENOENT (No such file or directory)
08:54:14.410345 brk(NULL) = 0x9b1000
08:54:14.410397 brk(0x9d2000) = 0x9d2000
08:54:14.410452 open("/proc/filesystems", O_RDONLY) = 3
08:54:14.410540 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
08:54:14.410607 read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tr"..., 1024) = 362
08:54:14.410698 read(3, "", 1024) = 0
08:54:14.410763 close(3) = 0
08:54:14.410857 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
08:54:14.410918 fstat(3, {st_mode=S_IFREG|0644, st_size=1668976, ...}) = 0
08:54:14.410964 mmap(NULL, 1668976, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff0a64f8000
08:54:14.410997 close(3) = 0
08:54:14.411040 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
08:54:14.411092 fstat(3, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
08:54:14.411139 read(3, "# Locale name alias data base.\n#"..., 4096) = 2995
08:54:14.411247 read(3, "", 4096) = 0
08:54:14.411299 close(3) = 0
08:54:14.411405 open("/usr/lib/locale/it_IT.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411460 open("/usr/lib/locale/it_IT.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411511 open("/usr/lib/locale/it_IT/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411550 open("/usr/lib/locale/it.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411603 open("/usr/lib/locale/it.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411668 open("/usr/lib/locale/it/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:54:14.411711 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
08:54:14.411759 ioctl(1, TIOCGWINSZ, {ws_row=88, ws_col=272, ws_xpixel=0, ws_ypixel=0}) = 0
08:54:14.411873 open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
08:54:14.411918 fstat(3, {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
08:54:14.873927 getdents(3,
一切就都结束了。
PS 在 Azure 仪表板上,我可以看到所有文件,但(据我所知)无法对目录进行批量下载。任何类似的解决方法也值得赞赏。更新对于这个特定的任务,您可以使用存储资源管理器。