Re: [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts

From: Al Viro

Date: Wed Apr 22 2026 - 10:39:32 EST


On Wed, Apr 22, 2026 at 02:30:03PM +0200, Thorsten Blum wrote:
> Drop the hard-coded length argument and use the simpler QSTR().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> fs/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index c7fac83c9a85..817bba800d7b 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
> */
> struct dentry *parent = dget_parent(path->dentry);
> struct dentry *child;
> - struct qstr this = QSTR_INIT("pts", 3);
> + struct qstr this = QSTR("pts");
>
> if (unlikely(!path_connected(path->mnt, parent))) {
> dput(parent);

NAK. Compound literal is an l-value, so let's just use it:
child = d_hash_and_lookup(parent, &QSTR("pts"));
and to hell with the local variable.