summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
diff options
context:
space:
mode:
authorAndrew Stormont <astormont@racktopsystems.com>2016-07-18 15:34:40 +0100
committerDan McDonald <danmcd@omniti.com>2016-07-22 10:15:57 -0400
commit6da83bb0b886fae280a129718d645576517b62c6 (patch)
tree603ab627f99e2010415e1e3755a2ee5f7115cde7 /usr/src/uts/common/fs/tmpfs/tmp_vnops.c
parentb6bd4f488cd95b4b547777e8a8ca2045ebb34fad (diff)
downloadillumos-joyent-6da83bb0b886fae280a129718d645576517b62c6.tar.gz
7203 unlinking a directory on tmpfs does not remove the directory entries
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Alexander Stetsenko <astetsenko@racktopsystems.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/uts/common/fs/tmpfs/tmp_vnops.c')
-rw-r--r--usr/src/uts/common/fs/tmpfs/tmp_vnops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
index 3c251df0cc..82195e6742 100644
--- a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
+++ b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
@@ -27,6 +27,7 @@
/*
* Copyright (c) 2015, Joyent, Inc. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2016 RackTop Systems.
*/
#include <sys/types.h>
@@ -1104,7 +1105,8 @@ tmp_remove(
if (tp->tn_type != VDIR ||
(error = secpolicy_fs_linkdir(cred, dvp->v_vfsp)) == 0)
- error = tdirdelete(parent, tp, nm, DR_REMOVE, cred);
+ error = tdirdelete(parent, tp, nm, tp->tn_type == VDIR ?
+ DR_RMDIR : DR_REMOVE, cred);
rw_exit(&tp->tn_rwlock);
rw_exit(&parent->tn_rwlock);