# \[PATCH v7 07/12\] fs/kernfs/symlink.c: replace S\_IRWXUGO with 0777 on kernfs\_create\_link()

- Subsystems: FILESYSTEMS (VFS and infrastructure), KERNFS, THE REST
- Maintainers: Alexander Viro, Christian Brauner, Greg Kroah-Hartman, Tejun Heo, Linus Torvalds
- List: cgroups
- 1 message, 1 author
- Page: https://ratatoskr.run/cgroups/2021/09/214566/t

## \[PATCH v7 07/12\] fs/kernfs/symlink.c: replace S\_IRWXUGO with 0777 on kernfs\_create\_link()

- From: Luis Chamberlain \<mcgrof@kernel.org\>
- Date: 2021-09-18 05:05:21 
- Message: https://ratatoskr.run/cgroups/2021/09/214566.md

```text
If one ends up extending this line checkpatch will complain about the
use of S_IRWXUGO suggesting it is not preferred and that 0777
should be used instead. Take the tip from checkpatch and do that
change before we do our subsequent changes.

This makes no functional changes.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 fs/kernfs/symlink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index c8f8e41b8411..19a6c71c6ff5 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -36,8 +36,7 @@ struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
 		gid = target->iattr->ia_gid;
 	}
 
-	kn = kernfs_new_node(parent, name, S_IFLNK|S_IRWXUGO, uid, gid,
-			     KERNFS_LINK);
+	kn = kernfs_new_node(parent, name, S_IFLNK|0777, uid, gid, KERNFS_LINK);
 	if (!kn)
 		return ERR_PTR(-ENOMEM);
 
-- 
2.30.2

```
