Bug #15702
closedmds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfs
0%
Description
This issue should happen on kcephfs only. My kernel version is 3.10.94. I think it might also happen on other 3.x versions.
Steps to reproduce on kcephfs:
1. Create a symlink to a directory, both are on kcephfs.
2. Use opendir/readdir function to open/read this symlink. It will succeed at this time.
3. Wait for some time or just umount cephfs and remount it for quick validation.
4. Just Use opendir/readdir function to open/read this symlink again without any other ops before opendir. Now it will fail.
The root cause is that after some time, this symlink's inode lease will be invalid (function: ceph_d_revalidate). When accessing this inode next time, kcephfs uses atomic_open on it and send related req to MDS. MDS treats this inode as a file but its flag is O_DIRECTORY, so MDS return EINVAL to client. Similar reason when using umounting/remounting for valication.
The fix could be checking if this indoe is symlink on MDS side for atomic_open. If it is, MSD could return this inode's info to client, then client could fill this inode with correct info and set inode's iop to symlink iops. Then kernel will retry on this symlink.
Updated by Zhi Zhang almost 8 years ago
I have tried to backport Yan's following patch, which can only resolve this issue when symlink dentry is invalid, but can't fully resolve it if umounting/remounting cephfs again.
So I made above change on MDS side, which can resolve both cases.
Updated by Nathan Cutler almost 8 years ago
- Project changed from Ceph to CephFS
- Category deleted (
1) - Status changed from New to Fix Under Review
Updated by Greg Farnum almost 8 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from hammer to hammer, jewel
Updated by Loïc Dachary almost 8 years ago
- Copied to Backport #16082: hammer: mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfs added
Updated by Loïc Dachary almost 8 years ago
- Copied to Backport #16083: jewel: mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfs added
Updated by Loïc Dachary over 7 years ago
- Status changed from Pending Backport to Resolved