Skip to contentSkip to conversation

v9fs: assign dentry ops to negative dentries

PATCH New Eric Van Hensbergen 1 participant 1 message Mar 17, 2006 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v9fs: assign dentry ops to negative dentries

Subject: [PATCH] assign dentry ops to negative dentries
From: Latchesar Ionkov <[email protected]>
Date: 1142219619 -0500

If a file is not found in v9fs_vfs_lookup, the function creates negative dentry, but doesn't assign any dentry ops. This leaves the negative entry in the cache (there is no d_delete to mark it for removal). If the file is created outside of the mounted v9fs filesystem, the file shows up in the directory with weird permissions.

This patch assigns the default v9fs dentry ops to the negative dentry.

---

 fs/9p/vfs_inode.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

1c2ced3fa5281cc5f96272186c8f180b8e2823c8

fs/9p/vfs_inode.c +1 -2
index 3438e6a..d3c4cd4 100644
@@ -614,6 +614,7 @@ static struct dentry *v9fs_vfs_lookup(st
 
 	sb = dir->i_sb;
 	v9ses = v9fs_inode2v9ses(dir);
+	dentry->d_op = &v9fs_dentry_operations;
 	dirfid = v9fs_fid_lookup(dentry->d_parent);
 
 	if (!dirfid) {
@@ -681,8 +682,6 @@ static struct dentry *v9fs_vfs_lookup(st
 		goto FreeFcall;
 
 	fid->qid = fcall->params.rstat.stat.qid;
-
-	dentry->d_op = &v9fs_dentry_operations;
 	v9fs_stat2inode(&fcall->params.rstat.stat, inode, inode->i_sb);
 
 	d_add(dentry, inode);
Signature · 1 line
1.1.0