Skip to content

Commit 1191a2b

Browse files
Miklos SzerediAl Viro
authored andcommitted
gfs2: use check_submounts_and_drop()
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>
1 parent ba81238 commit 1191a2b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎fs/gfs2/dentry.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
9393
if (!had_lock)
9494
gfs2_glock_dq_uninit(&d_gh);
9595
invalid:
96-
if (inode && S_ISDIR(inode->i_mode)) {
97-
if (have_submounts(dentry))
98-
goto valid;
99-
shrink_dcache_parent(dentry);
100-
}
101-
d_drop(dentry);
96+
if (check_submounts_and_drop(dentry) != 0)
97+
goto valid;
98+
10299
dput(parent);
103100
return 0;
104101

0 commit comments

Comments
 (0)