diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2025-09-29 15:02:46 +0200 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2025-11-13 10:38:01 +0100 |
| commit | 47781ee71fb6bf2e082580b98be72411b99b6e04 (patch) | |
| tree | 7e5fa762ad60f7c71bbf4f6728ea4992fc524481 | |
| parent | c755a09b52c09b8d67ef35b4ac3166ca6e797bee (diff) | |
fuse: rename 'namelen' to 'namesize'
By "length of a string" usually the number of non-null chars is
meant (i.e. strlen(str)). So the variable 'namelen' was confusingly
named, whereas 'namesize' refers more to what's being done in
'get_security_context'.
Suggested-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
| -rw-r--r-- | fs/fuse/dir.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 70f364aa6541..963f53f394c6 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -666,7 +666,7 @@ static int get_security_context(struct dentry *entry, umode_t mode, u32 total_len = sizeof(*header); int err, nr_ctx = 0; const char *name = NULL; - size_t namelen; + size_t namesize; err = security_dentry_init_security(entry, mode, &entry->d_name, &name, &lsmctx); @@ -677,12 +677,12 @@ static int get_security_context(struct dentry *entry, umode_t mode, if (lsmctx.len) { nr_ctx = 1; - namelen = strlen(name) + 1; + namesize = strlen(name) + 1; err = -EIO; - if (WARN_ON(namelen > XATTR_NAME_MAX + 1 || + if (WARN_ON(namesize > XATTR_NAME_MAX + 1 || lsmctx.len > S32_MAX)) goto out_err; - total_len += FUSE_REC_ALIGN(sizeof(*fctx) + namelen + + total_len += FUSE_REC_ALIGN(sizeof(*fctx) + namesize + lsmctx.len); } @@ -699,8 +699,8 @@ static int get_security_context(struct dentry *entry, umode_t mode, fctx->size = lsmctx.len; ptr += sizeof(*fctx); - strscpy(ptr, name, namelen); - ptr += namelen; + strscpy(ptr, name, namesize); + ptr += namesize; memcpy(ptr, lsmctx.context, lsmctx.len); } |
