summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-01-16 22:55:25 +0000
committergreen <green@FreeBSD.org>2004-01-16 22:55:25 +0000
commitc684933315620a21c0b746eb74d01c137c84965e (patch)
tree18a1e1dff401664153008948326af973471e6577 /sys/fs
parentf5f86e003a78259037db3ea51f971eb492eeabd7 (diff)
downloadFreeBSD-src-c684933315620a21c0b746eb74d01c137c84965e.zip
FreeBSD-src-c684933315620a21c0b746eb74d01c137c84965e.tar.gz
Do not allow operations which cause known file-system corruption.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/unionfs/union_vnops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 603acd1..3a5838e 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -1224,7 +1224,10 @@ union_remove(ap)
if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
if (union_dowhiteout(un, cnp->cn_cred, td))
cnp->cn_flags |= DOWHITEOUT;
- error = VOP_REMOVE(upperdvp, uppervp, cnp);
+ if (cnp->cn_flags & DOWHITEOUT) /* XXX fs corruption */
+ error = EOPNOTSUPP;
+ else
+ error = VOP_REMOVE(upperdvp, uppervp, cnp);
if (!error)
union_removed_upper(un);
union_unlock_upper(uppervp, td);
@@ -1538,7 +1541,10 @@ union_rmdir(ap)
if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
if (union_dowhiteout(un, cnp->cn_cred, td))
cnp->cn_flags |= DOWHITEOUT;
- error = VOP_RMDIR(upperdvp, uppervp, ap->a_cnp);
+ if (cnp->cn_flags & DOWHITEOUT) /* XXX fs corruption */
+ error = EOPNOTSUPP;
+ else
+ error = VOP_RMDIR(upperdvp, uppervp, ap->a_cnp);
if (!error)
union_removed_upper(un);
union_unlock_upper(uppervp, td);
OpenPOWER on IntegriCloud