aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>1998-09-30 00:53:40 +0000
committerKirk McKusick <mckusick@FreeBSD.org>1998-09-30 00:53:40 +0000
commitdf077352a79ed01218b86f95d6ca29c48225a720 (patch)
tree48f609bcaa6cbfbc8d607b1a9552b4bfe253ceae
parent6a04333133886a742f1cabccae7c854b3f8fe1bf (diff)
Notes
-rw-r--r--sys/ufs/ufs/ufs_vnops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 486401e2d5d2..11592f981d1a 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $Id: ufs_vnops.c,v 1.98 1998/08/12 20:46:47 julian Exp $
+ * $Id: ufs_vnops.c,v 1.99 1998/08/12 21:42:54 msmith Exp $
*/
#include "opt_quota.h"
@@ -1481,7 +1481,9 @@ ufs_rmdir(ap)
* Do not remove a directory that is in the process of being renamed.
* Verify the directory is empty (and valid). Rmdir ".." will not be
* valid since ".." will contain a reference to the current directory
- * and thus be non-empty.
+ * and thus be non-empty. Do not allow the removal of mounted on
+ * directories (this can happen when an NFS exported filesystem
+ * tries to remove a locally mounted on directory).
*/
error = 0;
if (ip->i_flag & IN_RENAME) {
@@ -1498,6 +1500,10 @@ ufs_rmdir(ap)
error = EPERM;
goto out;
}
+ if (vp->v_mountedhere != 0) {
+ error = EINVAL;
+ goto out;
+ }
/*
* Delete reference to directory before purging
* inode. If we crash in between, the directory