diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-04-21 04:35:09 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-05-23 14:20:44 +0200 |
| commit | 7fc711739eb8c30955fd8a85be0db7d5a0aa10ae (patch) | |
| tree | ee027ae22fa71de1bebbe55fd0bfbe2cc2e6e381 /fs/namespace.c | |
| parent | a68cb18624503a09a1b10e72c3bcc90f2eeb3ded (diff) | |
->mnt_devname is never NULL
Not since 8f2918898eb5 "new helpers: vfs_create_mount(), fc_mount()"
back in 2018. Get rid of the dead checks...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/20250421033509.GV2023217@ZenIV
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/namespace.c')
| -rw-r--r-- | fs/namespace.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index ddb0a688633c..924298d11df7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -355,12 +355,13 @@ static struct mount *alloc_vfsmnt(const char *name) if (err) goto out_free_cache; - if (name) { + if (name) mnt->mnt_devname = kstrdup_const(name, GFP_KERNEL_ACCOUNT); - if (!mnt->mnt_devname) - goto out_free_id; - } + else + mnt->mnt_devname = "none"; + if (!mnt->mnt_devname) + goto out_free_id; #ifdef CONFIG_SMP mnt->mnt_pcp = alloc_percpu(struct mnt_pcp); @@ -1268,7 +1269,7 @@ struct vfsmount *vfs_create_mount(struct fs_context *fc) if (!fc->root) return ERR_PTR(-EINVAL); - mnt = alloc_vfsmnt(fc->source ?: "none"); + mnt = alloc_vfsmnt(fc->source); if (!mnt) return ERR_PTR(-ENOMEM); @@ -5483,7 +5484,7 @@ static int statmount_sb_source(struct kstatmount *s, struct seq_file *seq) seq->buf[seq->count] = '\0'; seq->count = start; seq_commit(seq, string_unescape_inplace(seq->buf + start, UNESCAPE_OCTAL)); - } else if (r->mnt_devname) { + } else { seq_puts(seq, r->mnt_devname); } return 0; |
