diff options
author | green <green@FreeBSD.org> | 2004-01-16 22:55:25 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2004-01-16 22:55:25 +0000 |
commit | c684933315620a21c0b746eb74d01c137c84965e (patch) | |
tree | 18a1e1dff401664153008948326af973471e6577 /sys/fs | |
parent | f5f86e003a78259037db3ea51f971eb492eeabd7 (diff) | |
download | FreeBSD-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.c | 10 |
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); |