Project

General

Profile

Actions

Bug #15702

closed

mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfs

Added by Zhi Zhang almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
hammer, jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.


Related issues 2 (0 open2 closed)

Copied to CephFS - Backport #16082: hammer: mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfsResolvedNathan CutlerActions
Copied to CephFS - Backport #16083: jewel: mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfsResolvedNathan CutlerActions
Actions

Also available in: Atom PDF