diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/debugfs/file.c | 3 | ||||
| -rw-r--r-- | fs/debugfs/inode.c | 5 | ||||
| -rw-r--r-- | fs/kernfs/dir.c | 4 | ||||
| -rw-r--r-- | fs/kernfs/inode.c | 4 | ||||
| -rw-r--r-- | fs/kernfs/symlink.c | 2 |
5 files changed, 11 insertions, 7 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index edd6aafbf..08de6652a 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -273,7 +273,8 @@ static int debugfs_locked_down(struct inode *inode, (!real_fops || (!real_fops->unlocked_ioctl && !real_fops->compat_ioctl && - !real_fops->mmap))) + !real_fops->mmap && + !real_fops->mmap_prepare))) return 0; if (security_locked_down(LOCKDOWN_DEBUGFS)) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 459814235..e054e6291 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -368,8 +368,11 @@ static struct dentry *debugfs_start_creating(const char *name, if (!debugfs_enabled) return ERR_PTR(-EPERM); - if (!debugfs_initialized()) + if (!debugfs_initialized()) { + pr_err("Unable to create file '%s', debugfs is not initialized yet\n", + name); return ERR_PTR(-ENOENT); + } pr_debug("creating file '%s'\n", name); diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 97d9d227b..82bbaeb32 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -330,8 +330,8 @@ static unsigned int kernfs_name_hash(const char *name, const struct ns_common *ns) { unsigned long hash = init_name_hash(kernfs_ns_id(ns)); - unsigned int len = strlen(name); - while (len--) + + while (*name) hash = partial_name_hash(*name++, hash); hash = end_name_hash(hash); hash &= 0x7fffffffU; diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index 2cb20294a..237dcdd73 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -141,9 +141,9 @@ ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size) struct kernfs_node *kn = kernfs_dentry_node(dentry); struct kernfs_iattrs *attrs; - attrs = kernfs_iattrs(kn); + attrs = kernfs_iattrs_noalloc(kn); if (!attrs) - return -ENOMEM; + return 0; return simple_xattr_list(d_inode(dentry), &attrs->xattrs, buf, size); } diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index 0bd8a2143..90e2b3221 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c @@ -73,7 +73,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent, if ((s - path) + 3 >= PATH_MAX) return -ENAMETOOLONG; - strcpy(s, "../"); + memcpy(s, "../", 4); s += 3; base = kernfs_parent(base); } |
