Skip to content

Commit 1eb7de1

Browse files
committed
Merge tag '9p-for-5.17-rc3' of git://github.com/martinetd/linux
Pull 9p fix from Dominique Martinet: "Fix 'cannot walk open fid' rule The 9p 'walk' operation requires fid arguments to not originate from an open or create call and we've missed that for a while as the servers regularly running tests with don't enforce the check and no active reviewer knew about the rule. Both reporters confirmed reverting this patch fixes things for them and looking at it further wasn't actually required... Will take more time for follow up and enforcing the rule more thoroughly later" * tag '9p-for-5.17-rc3' of git://github.com/martinetd/linux: Revert "fs/9p: search open fids first"
2 parents 633a8e8 + 22e424f commit 1eb7de1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fs/9p/fid.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,8 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
9696
dentry, dentry, from_kuid(&init_user_ns, uid),
9797
any);
9898
ret = NULL;
99-
100-
if (d_inode(dentry))
101-
ret = v9fs_fid_find_inode(d_inode(dentry), uid);
102-
10399
/* we'll recheck under lock if there's anything to look in */
104-
if (!ret && dentry->d_fsdata) {
100+
if (dentry->d_fsdata) {
105101
struct hlist_head *h = (struct hlist_head *)&dentry->d_fsdata;
106102

107103
spin_lock(&dentry->d_lock);
@@ -113,6 +109,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
113109
}
114110
}
115111
spin_unlock(&dentry->d_lock);
112+
} else {
113+
if (dentry->d_inode)
114+
ret = v9fs_fid_find_inode(dentry->d_inode, uid);
116115
}
117116

118117
return ret;

0 commit comments

Comments
 (0)