svn commit: r238773 - projects/fuse/sys/fs/fuse
Attilio Rao
attilio at FreeBSD.org
Wed Jul 25 17:15:53 UTC 2012
Author: attilio
Date: Wed Jul 25 17:15:52 2012
New Revision: 238773
URL: http://svn.freebsd.org/changeset/base/238773
Log:
In VOP_RMDIR and VOP_REMOVE the last comonent name will be used, thus
when doing lookup the buffer must not be freed when nameiop == DELETE.
Reported by: pho
Tested by: pho, flo
Modified:
projects/fuse/sys/fs/fuse/fuse_vnops.c
Modified: projects/fuse/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- projects/fuse/sys/fs/fuse/fuse_vnops.c Wed Jul 25 13:11:36 2012 (r238772)
+++ projects/fuse/sys/fs/fuse/fuse_vnops.c Wed Jul 25 17:15:52 2012 (r238773)
@@ -871,19 +871,19 @@ calldaemon:
if (nid == VTOI(dvp)) {
vref(dvp);
*vpp = dvp;
- goto out;
- }
- err = fuse_vnode_get(dvp->v_mount,
- nid,
- dvp,
- &vp,
- cnp,
- IFTOVT(fattr->mode));
- if (err) {
- goto out;
+ } else {
+ err = fuse_vnode_get(dvp->v_mount, nid, dvp,
+ &vp, cnp, IFTOVT(fattr->mode));
+ if (err)
+ goto out;
+ *vpp = vp;
}
- *vpp = vp;
+ /*
+ * Save the name for use in VOP_RMDIR and VOP_REMOVE
+ * later.
+ */
+ cnp->cn_flags |= SAVENAME;
goto out;
}
More information about the svn-src-projects
mailing list