NFSv4“符号链接级别过多”错误

use*_*058 6 symbolic-link nfs4

两台机器都运行 Ubuntu 12.04

远程 NFSv4 客户端

$ ls /mnt/storage/aaaaaaa_aaa/bbbb/cccc_ccccc gives this error:
ls: reading directory .: Too many levels of symbolic links
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

当发生错误时,ls 开始列出文件,但是 PHP 会刹车。

在 NFSv4 服务器上

/etc/fstab

/mnt/storage    /srv/storage    none    bind    0 0
Run Code Online (Sandbox Code Playgroud)

/etc/exports

/srv         192.168.1.0/24(rw,async,insecure,no_subtree_check,crossmnt,fsid=0,no_root_squash)
/srv/storage   192.168.1.0/24(rw,async,nohide,insecure,no_subtree_check,no_root_squash)
Run Code Online (Sandbox Code Playgroud)

错误

root@ds:root@ds:/mnt/storage/foreign_dbs/imdb/imdb_htmls# ls -l | head
ls: reading directory .: Too many levels of symbolic links
total 10302840
-rw-r--r-- 1 root root  10484 Jul  5 13:56 0019038.gz
-rw-r--r-- 1 root root  16264 Mar 30 00:31 0259701.gz
-rw-r--r-- 1 root root  13784 Mar 30 14:20 1000000.gz
-rw-r--r-- 1 root root  12741 Mar 30 13:04 1000003.gz
-rw-r--r-- 1 root root  12794 Mar 30 12:40 1000004.gz
-rw-r--r-- 1 root root  13123 Mar 30 12:07 1000005.gz
-rw-r--r-- 1 root root  13183 Mar 30 12:04 1000006.gz
-rw-r--r-- 1 root root  13443 Jul  4 01:16 1000007.gz
-rw-r--r-- 1 root root  12968 Mar 30 11:05 1000008.gz
Run Code Online (Sandbox Code Playgroud)

我在 PHP 中遇到了它。scandir 将返回 1612577.gz 和 1612579.gz,但会跳过 1612578.gz,但它们的文件类型和属性是相同的

这仅发生在 nfs 客户端上,在服务器上 100% 工作

bah*_*mat 3

在某个地方,您有一个指向其父级的符号链接。使用这个来找到它:

find /mnt/storage -type l -exec ls -l {} \;
Run Code Online (Sandbox Code Playgroud)

一旦你这样做了,也许你就能弄清楚如何纠正它。