From: Al Viro Date: Fri, 12 Sep 2014 22:21:05 +0000 (-0400) Subject: gfs2_atomic_open(): skip lookups on hashed dentry X-Git-Tag: v3.18-rc1~76^2~9 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=4d93bc3e81736ce55c79d9cae743bab4f89b4f9c;p=~emulex%2Finfiniband.git gfs2_atomic_open(): skip lookups on hashed dentry hashed dentry can be passed to ->atomic_open() only if a) it has just passed revalidation and b) it's negative Signed-off-by: Al Viro --- diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index fc8ac2ee066..8108b4f0354 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1244,6 +1244,9 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry, struct dentry *d; bool excl = !!(flags & O_EXCL); + if (!d_unhashed(dentry)) + goto skip_lookup; + d = __gfs2_lookup(dir, dentry, file, opened); if (IS_ERR(d)) return PTR_ERR(d); @@ -1260,6 +1263,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry, } BUG_ON(d != NULL); + +skip_lookup: if (!(flags & O_CREAT)) return -ENOENT;