Skip to content

Commit

Permalink
gfs2_atomic_open(): skip lookups on hashed dentry
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Oct 9, 2014
1 parent 18c85d0 commit 4d93bc3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit 4d93bc3

Please sign in to comment.