我使用scp将一些文件复制到文件服务器主机上的XFS本地分区,并通过SSH在本地创建一个指向新部署文件的符号链接。该分区通过NFS导出,并在多个主机上挂载。
scp new-file-version fileserver:/nfs/exported/path
ssh fileserver ln -s new-file-version /nfs/exported/path/file如果我在本地检查文件服务器中部署的文件和符号链接,一切都很好:
fileserver$ ls -l /nfs/exported/path
lrwxrwxrwx 1 root root 56 Oct 30 12:30 file -> new-file-version
-rwxr-xr-x 11 root root 220 Oct 30 12:34 new-file-version
-rwxr-xr-x 11 root root 220 Oct 30 12:12 previous-file-version但是,当我试图查看已部署的文件或通过NFS复制它们时,我会在刚刚创建的符号链接中得到一些输入/输出错误:
nfsclient$ ls -l /nfs/mounted/path
ls: cannot read symbolic link /nfs/mounted/path/file: Input/output error
lrwxrwxrwx 1 root root 56 Oct 30 12:30 file
-rwxr-xr-x 11 root root 220 Oct 30 12:34 new-file-version
-rwxr-xr-x 11 root root 220 Oct 30 12:12 previous-file-versionNFS挂载路径上的stat命令报告以下信息:
nfsclient$ stat /nfs/mounted/path
File: '/nfs/mounted/path'
Size: 175 Blocks: 0 IO Block: 32768 directory
Device: 2ch/44d Inode: 560507638 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-11-02 14:25:04.677606317 +0100
Modify: 2018-11-02 14:25:28.630755680 +0100
Change: 2018-11-02 14:25:28.630755680 +0100
Birth: -注意,访问时间在修改/更改时间之前,尽管我刚刚读取了目录内容。
如果我重新尝试这个操作,经过几次尝试,它最终会成功:
nfsclient$ ls -l /nfs/mounted/path
lrwxrwxrwx 1 root root 56 Oct 30 12:30 file -> new-file-version
-rwxr-xr-x 11 root root 220 Oct 30 12:34 new-file-version
-rwxr-xr-x 11 root root 220 Oct 30 12:12 previous-file-version然后stat在更新访问时间后报告这些信息:
nfsclient$ stat /nfs/mounted/path
File: '/nfs/mounted/path'
Size: 175 Blocks: 0 IO Block: 32768 directory
Device: 2ch/44d Inode: 560507638 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-11-02 14:25:30.925774294 +0100
Modify: 2018-11-02 14:25:28.630755680 +0100
Change: 2018-11-02 14:25:28.630755680 +0100
Birth: -知道为什么会发生这种事吗?
发布于 2019-02-26 09:43:42
根据https://bugzilla.redhat.com/show_bug.cgi?id=1416532的说法,这是that 7.3中的一个bug,这正是我们使用的版本。
它已在内核内核中得到修正-3.10.0-562.el7。
https://unix.stackexchange.com/questions/479366
复制相似问题