Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile 2 (of many) from Al Viro: "Mostly Miklos' series this time" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: constify dcache.c inlined helpers where possible fuse: drop dentry on failed revalidate fuse: clean up return in fuse_dentry_revalidate() fuse: use d_materialise_unique() sysfs: use check_submounts_and_drop() nfs: use check_submounts_and_drop() gfs2: use check_submounts_and_drop() afs: use check_submounts_and_drop() vfs: check unlinked ancestors before mount vfs: check submounts and drop atomically vfs: add d_walk() vfs: restructure d_genocide()
This commit is contained in:
@@ -611,6 +611,7 @@ static struct mountpoint *new_mountpoint(struct dentry *dentry)
|
||||
{
|
||||
struct list_head *chain = mountpoint_hashtable + hash(NULL, dentry);
|
||||
struct mountpoint *mp;
|
||||
int ret;
|
||||
|
||||
list_for_each_entry(mp, chain, m_hash) {
|
||||
if (mp->m_dentry == dentry) {
|
||||
@@ -626,14 +627,12 @@ static struct mountpoint *new_mountpoint(struct dentry *dentry)
|
||||
if (!mp)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
spin_lock(&dentry->d_lock);
|
||||
if (d_unlinked(dentry)) {
|
||||
spin_unlock(&dentry->d_lock);
|
||||
ret = d_set_mounted(dentry);
|
||||
if (ret) {
|
||||
kfree(mp);
|
||||
return ERR_PTR(-ENOENT);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
dentry->d_flags |= DCACHE_MOUNTED;
|
||||
spin_unlock(&dentry->d_lock);
|
||||
|
||||
mp->m_dentry = dentry;
|
||||
mp->m_count = 1;
|
||||
list_add(&mp->m_hash, chain);
|
||||
|
Reference in New Issue
Block a user