Skip to content

Commit

Permalink
gfs2: use check_submounts_and_drop()
Browse files Browse the repository at this point in the history
Do have_submounts(), shrink_dcache_parent() and d_drop() atomically.

check_submounts_and_drop() can deal with negative dentries and
non-directories as well.

Non-directories can also be mounted on.  And just like directories we don't
want these to disappear with invalidation.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Sep 5, 2013
1 parent ba81238 commit 1191a2b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/gfs2/dentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
if (!had_lock)
gfs2_glock_dq_uninit(&d_gh);
invalid:
if (inode && S_ISDIR(inode->i_mode)) {
if (have_submounts(dentry))
goto valid;
shrink_dcache_parent(dentry);
}
d_drop(dentry);
if (check_submounts_and_drop(dentry) != 0)
goto valid;

dput(parent);
return 0;

Expand Down

0 comments on commit 1191a2b

Please sign in to comment.