Page MenuHomeFreeBSD

D32148.id95746.diff
No OneTemporary

D32148.id95746.diff

Index: sys/fs/unionfs/union_subr.c
===================================================================
--- sys/fs/unionfs/union_subr.c
+++ sys/fs/unionfs/union_subr.c
@@ -629,6 +629,8 @@
udvp = UNIONFSVPTOUPPERVP(dvp);
vp = NULLVP;
+ KASSERT((cnp->cn_flags & HASBUF) != 0,
+ ("%s called without HASBUF", __func__));
error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr,
cnp->cn_namelen, CREATE);
if (error)
@@ -663,6 +665,8 @@
udvp = UNIONFSVPTOUPPERVP(dvp);
vp = NULLVP;
+ KASSERT((cnp->cn_flags & HASBUF) != 0,
+ ("%s called without HASBUF", __func__));
error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr,
cnp->cn_namelen, DELETE);
if (error)
@@ -697,6 +701,8 @@
udvp = UNIONFSVPTOUPPERVP(dvp);
vp = NULLVP;
+ KASSERT((cnp->cn_flags & HASBUF) != 0,
+ ("%s called without HASBUF", __func__));
error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr,
cnp->cn_namelen, RENAME);
if (error)
Index: sys/fs/unionfs/union_vnops.c
===================================================================
--- sys/fs/unionfs/union_vnops.c
+++ sys/fs/unionfs/union_vnops.c
@@ -1372,7 +1372,7 @@
error = VOP_GETATTR(udvp, &va, cnp->cn_cred);
if (error != 0)
return (error);
- if (va.va_flags & OPAQUE)
+ if ((va.va_flags & OPAQUE) != 0)
cnp->cn_flags |= ISWHITEOUT;
}
@@ -1398,10 +1398,12 @@
struct unionfs_node *unp;
struct unionfs_mount *ump;
struct componentname *cnp;
+ struct componentname cn;
struct thread *td;
struct vnode *udvp;
struct vnode *uvp;
struct vnode *lvp;
+ struct vnode *vp;
int error;
UNIONFS_INTERNAL_DEBUG("unionfs_rmdir: enter\n");
@@ -1417,6 +1419,7 @@
udvp = dunp->un_uppervp;
uvp = unp->un_uppervp;
lvp = unp->un_lowervp;
+ vp = NULLVP;
if (udvp == NULLVP)
return (EROFS);
@@ -1433,8 +1436,16 @@
ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount);
if (ump->um_whitemode == UNIONFS_WHITE_ALWAYS || lvp != NULLVP)
cnp->cn_flags |= DOWHITEOUT;
- error = unionfs_relookup_for_delete(ap->a_dvp, cnp, td);
- if (!error)
+ error = unionfs_relookup(udvp, &vp, cnp, &cn, td,
+ unp->un_path, unp->un_pathlen, DELETE);
+ if (vp != NULLVP) {
+ if (udvp == vp)
+ vrele(vp);
+ else
+ vput(vp);
+ } else if (error == 0)
+ error = ENOENT;
+ if (error == 0)
error = VOP_RMDIR(udvp, uvp, cnp);
}
else if (lvp != NULLVP)

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 10, 9:13 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40536919
Default Alt Text
D32148.id95746.diff (2 KB)

Event Timeline