git: 06b782abaafe - stable/13 - tmpfs: remove duplicate flags check in tmpfs_rmdir
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Jan 2025 22:29:01 UTC
The branch stable/13 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=06b782abaafe56674fc2be847dea4ab28c1cddf0
commit 06b782abaafe56674fc2be847dea4ab28c1cddf0
Author: Claudiu <mscotty@protonmail.ch>
AuthorDate: 2024-10-13 20:00:42 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-01-20 22:27:26 +0000
tmpfs: remove duplicate flags check in tmpfs_rmdir
Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D47100
(cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924)
---
sys/fs/tmpfs/tmpfs_vnops.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 3c61938f8cae..f1add1ed6ab9 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -1307,6 +1307,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;
@@ -1324,13 +1325,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)