Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-06 Thread Nikolay Borisov
On 6.04.2018 11:13, David Howells wrote: > Al Viro wrote: > >> lookup_one_len() seriously depends upon exclusive lock > > In the code it says: > > WARN_ON_ONCE(!inode_is_locked(base->d_inode)); > > which checks i_rwsem, but in the banner comment it says: > > * The caller must h

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-06 Thread David Howells
Hi Al, Here's an updated set of changes. I've improved the sysnames list handling and made it install a list consisting of a blank name if the names are cleared (I'm told this is what should happen). I've also reinstated the "." and ".." checks in afs_lookup_rec() to catch substitution creating

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-06 Thread David Howells
How about the attached changes? Note that I've put the checks for ".", ".." and names containing '/' in the functions where the strings for @sys and @cell are set. David --- diff --git a/fs/afs/dir.c b/fs/afs/dir.c index a14ea4280590..5e3a0ed2043f 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-06 Thread David Howells
Al Viro wrote: > lookup_one_len() seriously depends upon exclusive lock In the code it says: WARN_ON_ONCE(!inode_is_locked(base->d_inode)); which checks i_rwsem, but in the banner comment it says: * The caller must hold base->i_mutex. is one of these wrong? David

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-06 Thread David Howells
Al Viro wrote: > > +static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry > > *dentry, > > + struct key *key) > > +{ > > > + ret = lookup_one_len(buf, parent, len); > > Er... Parent is locked only shared here and lookup_one_len() se

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-05 Thread Al Viro
On Thu, Apr 05, 2018 at 09:30:04PM +0100, David Howells wrote: > +static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry > *dentry, > +struct key *key) > +{ > + ret = lookup_one_len(buf, parent, len); Er... Parent is locked only s

Re: [PATCH 05/20] afs: Implement @sys substitution handling

2018-04-05 Thread Christoph Hellwig
On Thu, Apr 05, 2018 at 09:30:04PM +0100, David Howells wrote: > Implement the AFS feature by which @sys at the end of a pathname component > may be substituted for one of a list of values, typically naming the > operating system. Up to 16 alternatives may be specified and these are > tried in tur

[PATCH 05/20] afs: Implement @sys substitution handling

2018-04-05 Thread David Howells
Implement the AFS feature by which @sys at the end of a pathname component may be substituted for one of a list of values, typically naming the operating system. Up to 16 alternatives may be specified and these are tried in turn until one works. Each network namespace has[*] a separate independen