From 40e5945377e1b71dbd6afeaa10ea17f2b876db86 Mon Sep 17 00:00:00 2001 From: green Date: Thu, 17 Jun 2004 16:40:56 +0000 Subject: [PATCH 1/1] b=3643 Only try to look for GNS mount objects inside of directories. --- lustre/llite/dcache.c | 2 +- lustre/llite/llite_gns.c | 1 + lustre/llite/namei.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index 436dea9..a338e40 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -330,7 +330,7 @@ int ll_revalidate_it(struct dentry *de, int flags, struct nameidata *nd, atomic_read(&de->d_count)); ll_lookup_finish_locks(it, de); de->d_flags &= ~DCACHE_LUSTRE_INVALID; - if (!(de->d_inode->i_mode & S_ISUID) || + if (!((de->d_inode->i_mode & S_ISUID) &&S_ISDIR(de->d_inode->i_mode)) || !(flags & LOOKUP_CONTINUE || (it->it_op & (IT_CHDIR | IT_OPEN)))) return rc; diff --git a/lustre/llite/llite_gns.c b/lustre/llite/llite_gns.c index 38cdc53..bea1161 100644 --- a/lustre/llite/llite_gns.c +++ b/lustre/llite/llite_gns.c @@ -109,6 +109,7 @@ int ll_dir_process_mount_object(struct dentry *dentry, struct vfsmount *mnt) } LASSERT(dentry->d_inode != NULL); + LASSERT(S_ISDIR(dentry->d_inode->i_mode)); LASSERT(lld != NULL); sbi = ll_i2sbi(dentry->d_inode); LASSERT(sbi != NULL); diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 85f950e..61cf15b 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -378,6 +378,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, if (nd && dentry->d_inode != NULL && dentry->d_inode->i_mode & S_ISUID && + S_ISDIR(dentry->d_inode->i_mode) && (flags & LOOKUP_CONTINUE || (it->it_op & (IT_CHDIR | IT_OPEN)))) ll_dir_process_mount_object(dentry, nd->mnt); -- 1.8.3.1