1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

If someone tries to mount a union filesystem with another unionfs as

the upper layer, fail gracefully instead of panicing.

MFC after:	3 days
This commit is contained in:
David Schultz 2003-06-14 23:56:27 +00:00
parent 0614a6351f
commit ac092fb30c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116358

View File

@ -670,10 +670,20 @@ union_whiteout(ap)
struct vnode *uppervp;
int error = EOPNOTSUPP;
if ((uppervp = union_lock_upper(un, cnp->cn_thread)) != NULLVP) {
error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags);
union_unlock_upper(uppervp, cnp->cn_thread);
}
switch (ap->a_flags) {
case LOOKUP:
error = EOPNOTSUPP;
break;
case CREATE:
case DELETE:
if ((uppervp=union_lock_upper(un,cnp->cn_thread)) != NULLVP) {
error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags);
union_unlock_upper(uppervp, cnp->cn_thread);
}
break;
default:
panic("union_whiteout: unknown op");
}
return(error);
}