From: Al Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: torvalds@linux-foundation.org, brauner@kernel.org, jack@suse.cz,
neil@brown.name, linux-security-module@vger.kernel.org,
dhowells@redhat.com, linkinjeon@kernel.org
Subject: [PATCH 3/6] afs_edit_dir_{add,remove}(): constify qstr argument
Date: Thu, 11 Sep 2025 06:05:31 +0100 [thread overview]
Message-ID: <20250911050534.3116491-3-viro@zeniv.linux.org.uk> (raw)
In-Reply-To: <20250911050534.3116491-1-viro@zeniv.linux.org.uk>
Nothing outside of fs/dcache.c has any business modifying
dentry names; passing &dentry->d_name as an argument should
have that argument declared as a const pointer.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/afs/dir_edit.c | 4 ++--
fs/afs/internal.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/afs/dir_edit.c b/fs/afs/dir_edit.c
index 60a549f1d9c5..60b0f70f63a3 100644
--- a/fs/afs/dir_edit.c
+++ b/fs/afs/dir_edit.c
@@ -239,7 +239,7 @@ static void afs_edit_init_block(union afs_xdr_dir_block *meta,
* The caller must hold the inode locked.
*/
void afs_edit_dir_add(struct afs_vnode *vnode,
- struct qstr *name, struct afs_fid *new_fid,
+ const struct qstr *name, struct afs_fid *new_fid,
enum afs_edit_dir_reason why)
{
union afs_xdr_dir_block *meta, *block;
@@ -391,7 +391,7 @@ void afs_edit_dir_add(struct afs_vnode *vnode,
* The caller must hold the inode locked.
*/
void afs_edit_dir_remove(struct afs_vnode *vnode,
- struct qstr *name, enum afs_edit_dir_reason why)
+ const struct qstr *name, enum afs_edit_dir_reason why)
{
union afs_xdr_dir_block *meta, *block, *pblock;
union afs_xdr_dirent *de, *pde;
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 1124ea4000cb..db14882d367b 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -1097,9 +1097,9 @@ int afs_single_writepages(struct address_space *mapping,
/*
* dir_edit.c
*/
-extern void afs_edit_dir_add(struct afs_vnode *, struct qstr *, struct afs_fid *,
+extern void afs_edit_dir_add(struct afs_vnode *, const struct qstr *, struct afs_fid *,
enum afs_edit_dir_reason);
-extern void afs_edit_dir_remove(struct afs_vnode *, struct qstr *, enum afs_edit_dir_reason);
+extern void afs_edit_dir_remove(struct afs_vnode *, const struct qstr *, enum afs_edit_dir_reason);
void afs_edit_dir_update_dotdot(struct afs_vnode *vnode, struct afs_vnode *new_dvnode,
enum afs_edit_dir_reason why);
void afs_mkdir_init_dir(struct afs_vnode *dvnode, struct afs_vnode *parent_vnode);
--
2.47.2
next prev parent reply other threads:[~2025-09-11 5:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 5:01 [PATCHES] simple part of ->d_name stuff Al Viro
2025-09-11 5:05 ` [PATCH 1/6] security_dentry_init_security(): constify qstr argument Al Viro
2025-09-11 5:05 ` [PATCH 2/6] exfat_find(): " Al Viro
2025-09-11 6:02 ` Namjae Jeon
2025-09-15 12:45 ` Christian Brauner
2025-09-11 5:05 ` Al Viro [this message]
2025-09-15 12:45 ` [PATCH 3/6] afs_edit_dir_{add,remove}(): " Christian Brauner
2025-09-11 5:05 ` [PATCH 4/6] afs_dir_search: " Al Viro
2025-09-15 12:46 ` Christian Brauner
2025-09-11 5:05 ` [PATCH 5/6] generic_ci_validate_strict_name(): constify name argument Al Viro
2025-09-15 12:46 ` Christian Brauner
2025-09-11 5:05 ` [PATCH 6/6] make it easier to catch those who try to modify ->d_name Al Viro
2025-09-15 12:46 ` Christian Brauner
2025-09-11 14:30 ` [PATCH 1/6] security_dentry_init_security(): constify qstr argument Casey Schaufler
2025-09-11 20:54 ` Paul Moore
2025-09-15 12:45 ` Christian Brauner
2025-09-11 5:59 ` [PATCHES] simple part of ->d_name stuff David Howells
2025-09-11 16:56 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250911050534.3116491-3-viro@zeniv.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=brauner@kernel.org \
--cc=dhowells@redhat.com \
--cc=jack@suse.cz \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=neil@brown.name \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox