diff options
author | Claudiu <mscotty@protonmail.ch> | 2024-10-13 20:00:42 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2025-01-20 16:20:20 +0000 |
commit | 4ea15740a87314302dcb79d48b9280be199b0173 (patch) | |
tree | 327ceca6865351d2ce3d8d0f5c3233a6a2eaf859 | |
parent | e2cbfa1f5045019d34eb0091db7755c151ea06d5 (diff) |
tmpfs: remove duplicate flags check in tmpfs_rmdir
Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D47100
(cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924)
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 729feb0329a4..a42ada6a5469 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1327,6 +1327,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Check flags to see if we are allowed to remove the directory. */ if ((dnode->tn_flags & APPEND) || (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; @@ -1344,13 +1345,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); - /* Check flags to see if we are allowed to remove the directory. */ - if ((dnode->tn_flags & APPEND) != 0 || - (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { - error = EPERM; - goto out; - } - /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) |