Print this page
7656 unlinking directory on tmpfs can cause kernel panic
*** 1103,1114 ****
rw_enter(&parent->tn_rwlock, RW_WRITER);
rw_enter(&tp->tn_rwlock, RW_WRITER);
if (tp->tn_type != VDIR ||
(error = secpolicy_fs_linkdir(cred, dvp->v_vfsp)) == 0)
! error = tdirdelete(parent, tp, nm, tp->tn_type == VDIR ?
! DR_RMDIR : DR_REMOVE, cred);
rw_exit(&tp->tn_rwlock);
rw_exit(&parent->tn_rwlock);
vnevent_remove(TNTOV(tp), dvp, nm, ct);
tmpnode_rele(tp);
--- 1103,1113 ----
rw_enter(&parent->tn_rwlock, RW_WRITER);
rw_enter(&tp->tn_rwlock, RW_WRITER);
if (tp->tn_type != VDIR ||
(error = secpolicy_fs_linkdir(cred, dvp->v_vfsp)) == 0)
! error = tdirdelete(parent, tp, nm, DR_REMOVE, cred);
rw_exit(&tp->tn_rwlock);
rw_exit(&parent->tn_rwlock);
vnevent_remove(TNTOV(tp), dvp, nm, ct);
tmpnode_rele(tp);