X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fafs%2Fmntpt.c;h=bfc28abe1cb1c13b6a11497ff0cb0ca1ae3705e3;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=8b5c1e2e50b024a62b870c8ba97bfb3ce0a62961;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index 8b5c1e2e5..bfc28abe1 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c @@ -235,8 +235,8 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt) */ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) { - struct nameidata newnd; struct vfsmount *newmnt; + struct dentry *old_dentry; int err; kenter("%p{%s},{%s:%p{%s}}", @@ -247,15 +247,19 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) nd->dentry->d_name.name); newmnt = afs_mntpt_do_automount(dentry); - if (IS_ERR(newmnt)) + if (IS_ERR(newmnt)) { + path_release(nd); return PTR_ERR(newmnt); + } - newnd = *nd; - newnd.dentry = dentry; - err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts); + old_dentry = nd->dentry; + nd->dentry = dentry; + err = do_add_mount(newmnt, nd, 0, &afs_vfsmounts); + nd->dentry = old_dentry; + + path_release(nd); if (!err) { - path_release(nd); mntget(newmnt); nd->mnt = newmnt; dget(newmnt->mnt_root);