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

2018-07-31 Thread David Howells
Darrick J. Wong wrote: > I only have time today to review the user interface bits... Thanks:-) > > + fsinfo_attr_volume_id = 7,/* Volume ID (string) */ > > + fsinfo_attr_volume_uuid = 8,/* Volume UUID (LE uuid) */ > > + fsinfo_attr_volume_name = 9,/*

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

2018-07-31 Thread Darrick J. Wong
On Fri, Jul 27, 2018 at 06:35:10PM +0100, David Howells 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. > > === > NEW SYSTEM CALL

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

2018-07-31 Thread David Howells
Jann Horn wrote: > > + 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

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

2018-07-31 Thread David Howells
Al Viro wrote: > Umm... What's so special about cell/volume/domain/realm? Nothing particularly. But they're something various network filesystems might find useful. cell for AFS, domain for CIFS, realm for things that use kerberos. volume_id/uuid/name would be usable by ext4 too, for example

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

2018-07-30 Thread Al Viro
On Fri, Jul 27, 2018 at 06:35:10PM +0100, David Howells wrote: > params->request indicates the attribute/attributes to be queried. This can > be one of: > > fsinfo_attr_statfs - statfs-style info > fsinfo_attr_fsinfo - Information about fsinfo() > fsinf

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

2018-07-30 Thread David Howells
Andy Lutomirski wrote: > Constants are almost always all caps. Is there any reason these are > lowercase? It's also easier to create macros that pair structs or functions with the contants by name. David

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

2018-07-27 Thread Anton Altaparmakov
Hi David, > On 28 Jul 2018, at 00:49, David Howells wrote: > Jann Horn wrote: >>> +static int fsinfo_generic_name_encoding(struct dentry *dentry, char *buf) >>> +{ >>> + static const char encoding[] = "utf8"; >>> + >>> + if (buf) >>> + memcpy(buf, encoding, sizeof(encod

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

2018-07-27 Thread David Howells
Jann Horn wrote: > > fs/fat/inode.c: sprintf(buf, "cp%d", sbi->options.codepage); > > sprintf(buf, "cp%d", sbi->options.codepage); > sbi->nls_disk = load_nls(buf); > if (!sbi->nls_disk) { > fat_msg(sb, KERN_ERR, "codepage %s not found", buf); >

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

2018-07-27 Thread Jann Horn
On Sat, Jul 28, 2018 at 1:51 AM David Howells wrote: > David Howells wrote: > > > One thing I'm confused about is that fat has both a codepage and a charset > > and > > I'm not sure of the difference. > > In fact, it's not clear that the codepage is actually used. > > warthog>git grep '[

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

2018-07-27 Thread David Howells
David Howells wrote: > One thing I'm confused about is that fat has both a codepage and a charset and > I'm not sure of the difference. In fact, it's not clear that the codepage is actually used. warthog>git grep '[.>]codepage' fs/fat/inode.c: opts->codepage = fat_default_codepa

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

2018-07-27 Thread David Howells
Jann Horn wrote: > > +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; > > +} >

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

2018-07-27 Thread Jann Horn
On Fri, Jul 27, 2018 at 7:36 PM David Howells 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. [...] > +static int fsinfo_generic_ids(struct

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

2018-07-27 Thread David Howells
Andy Lutomirski 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. > > Has anyone seriously reviewed this? I don't know. I've certainly

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

2018-07-27 Thread Andy Lutomirski
On Fri, Jul 27, 2018 at 10:35 AM, David Howells 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. Has anyone seriously reviewed this? It might

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

2018-07-27 Thread David Howells
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. === NEW SYSTEM CALL === The new system call looks like: int ret = fsinfo(