Thread (34 messages) 34 messages, 6 authors, 2018-08-01

Re: [PATCH 34/38] vfs: syscall: Add fsinfo() to query filesystem information [ver #10]

flat view

From: Jann Horn <jannh@google.com>
Date: 2018-07-28 00:39:13
Also in: linux-fsdevel, lkml

On Fri, Jul 27, 2018 at 7:36 PM David Howells [off-list ref] wrote:
Add a system call to allow filesystem information to be queried.  A request
value can be given to indicate the desired attribute.  Support is provided
for enumerating multi-value attributes.
[...]
quoted hunk ↗ jump to hunk
+static int fsinfo_generic_ids(struct dentry *dentry,
+                             struct fsinfo_ids *p)
+{
[...]
+       strcpy(p->f_fs_name, dentry->d_sb->s_type->name);
Can you use strlcpy() instead? From a quick look, I don't see anything
that actually limits the size of filesystem names, even though
everything in-kernel probably fits into the 16 bytes you've allocated
for the name.

[...]
quoted hunk ↗ jump to hunk
+static int fsinfo_generic_name_encoding(struct dentry *dentry, char *buf)
+{
+       static const char encoding[] = "utf8";
+
+       if (buf)
+               memcpy(buf, encoding, sizeof(encoding) - 1);
+       return sizeof(encoding) - 1;
+}
Is this meant to be "encoding to be used by userspace" or "encoding of
on-disk filenames"? If the former: That's always utf8, right? Are
there any plans to create filesystems that behave differently? If the
latter: This is wrong for e.g. a vfat mount that uses a codepage,
right? Should the default in that case not be "I don't know"?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help