Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread J. Bruce Fields
On Fri, Jan 17, 2014 at 04:03:43PM -0500, J. Bruce Fields wrote: > - d_splice_alias handles inode == NULL in the same way, Actually, not exactly; simplifying a bit, in the NULL case they do: d_splice_alias: __d_instantiate(dentry, NULL); security_d_i

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread J. Bruce Fields
On Fri, Jan 17, 2014 at 10:39:17AM -0500, J. Bruce Fields wrote: > On Fri, Jan 17, 2014 at 04:17:23AM -0800, Christoph Hellwig wrote: > > Also the inode == NULL case really should be split out from > > d_materialise_unique into a separate helper. It shares almost no > > code, is entirely undocumen

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread J. Bruce Fields
On Fri, Jan 17, 2014 at 10:04:30AM +, Steven Whitehouse wrote: > Hi, > > On Thu, 2014-01-16 at 13:51 -0500, J. Bruce Fields wrote: > > On Thu, Jan 16, 2014 at 11:54:07AM -0500, Bob Peterson wrote: > > > - Original Message - > > > | Something like this? > > > (snip) > > > | @@ -779,6 +7

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread J. Bruce Fields
On Fri, Jan 17, 2014 at 04:17:23AM -0800, Christoph Hellwig wrote: > On Wed, Jan 15, 2014 at 10:17:49AM -0500, J. Bruce Fields wrote: > > From: "J. Bruce Fields" > > > > d_splice_alias can create duplicate directory aliases (in the !new > > case), or (in the new case) d_move without holding appro

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread Christoph Hellwig
On Wed, Jan 15, 2014 at 10:17:49AM -0500, J. Bruce Fields wrote: > From: "J. Bruce Fields" > > d_splice_alias can create duplicate directory aliases (in the !new > case), or (in the new case) d_move without holding appropriate locks. > > d_materialise_unique deals with both of these problems. (

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-17 Thread Steven Whitehouse
Hi, On Thu, 2014-01-16 at 13:51 -0500, J. Bruce Fields wrote: > On Thu, Jan 16, 2014 at 11:54:07AM -0500, Bob Peterson wrote: > > - Original Message - > > | Something like this? > > (snip) > > | @@ -779,6 +782,11 @@ static struct dentry *__gfs2_lookup(struct inode > > *dir, > > | struct d

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread J. Bruce Fields
On Thu, Jan 16, 2014 at 11:54:07AM -0500, Bob Peterson wrote: > - Original Message - > | Something like this? > (snip) > | @@ -779,6 +782,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, > | struct dentry *dentry, > | } > | > | d = d_splice_alias(inode, dentry); > | +

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread Bob Peterson
- Original Message - | Something like this? (snip) | @@ -779,6 +782,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, | struct dentry *dentry, | } | | d = d_splice_alias(inode, dentry); | + if (IS_ERR(d)) { | + iput(inode); | + gfs2_glock

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread J. Bruce Fields
On Thu, Jan 16, 2014 at 04:15:42PM +, Steven Whitehouse wrote: > Hi, > > On Thu, 2014-01-16 at 11:10 -0500, J. Bruce Fields wrote: > > On Wed, Jan 15, 2014 at 10:17:49AM -0500, bfields wrote: > > > From: "J. Bruce Fields" > > > > > > d_splice_alias can create duplicate directory aliases (in

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread Steven Whitehouse
Hi, On Thu, 2014-01-16 at 11:10 -0500, J. Bruce Fields wrote: > On Wed, Jan 15, 2014 at 10:17:49AM -0500, bfields wrote: > > From: "J. Bruce Fields" > > > > d_splice_alias can create duplicate directory aliases (in the !new > > case), or (in the new case) d_move without holding appropriate locks

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread J. Bruce Fields
On Wed, Jan 15, 2014 at 10:17:49AM -0500, bfields wrote: > From: "J. Bruce Fields" > > d_splice_alias can create duplicate directory aliases (in the !new > case), or (in the new case) d_move without holding appropriate locks. > > d_materialise_unique deals with both of these problems. (The latt

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread Miklos Szeredi
On Thu, Jan 16, 2014 at 4:41 PM, J. Bruce Fields wrote: > And, sorry, I did miss that you said "non-directory". But I think you > have that backwards: d_splice_alias looks like: > > if (inode && S_ISDIR(inode->i_mode)) { > ... > } else { > d_instant

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-16 Thread J. Bruce Fields
On Wed, Jan 15, 2014 at 07:25:11PM +0100, Miklos Szeredi wrote: > On Wed, Jan 15, 2014 at 6:57 PM, J. Bruce Fields wrote: > > On Wed, Jan 15, 2014 at 06:34:56PM +0100, Miklos Szeredi wrote: > >> On Wed, 2014-01-15 at 10:17 -0500, J. Bruce Fields wrote: > >> > From: "J. Bruce Fields" > >> > > >> >

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-15 Thread Miklos Szeredi
On Wed, Jan 15, 2014 at 6:57 PM, J. Bruce Fields wrote: > On Wed, Jan 15, 2014 at 06:34:56PM +0100, Miklos Szeredi wrote: >> On Wed, 2014-01-15 at 10:17 -0500, J. Bruce Fields wrote: >> > From: "J. Bruce Fields" >> > >> > d_splice_alias can create duplicate directory aliases (in the !new >> > cas

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-15 Thread J. Bruce Fields
On Wed, Jan 15, 2014 at 06:34:56PM +0100, Miklos Szeredi wrote: > On Wed, 2014-01-15 at 10:17 -0500, J. Bruce Fields wrote: > > From: "J. Bruce Fields" > > > > d_splice_alias can create duplicate directory aliases (in the !new > > case), or (in the new case) d_move without holding appropriate loc

Re: [PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-15 Thread Miklos Szeredi
On Wed, 2014-01-15 at 10:17 -0500, J. Bruce Fields wrote: > From: "J. Bruce Fields" > > d_splice_alias can create duplicate directory aliases (in the !new > case), or (in the new case) d_move without holding appropriate locks. It can d_move, because the dentry is known to be disconnected, i.e. i

[PATCH] dcache: fix d_splice_alias handling of aliases

2014-01-15 Thread J. Bruce Fields
From: "J. Bruce Fields" d_splice_alias can create duplicate directory aliases (in the !new case), or (in the new case) d_move without holding appropriate locks. d_materialise_unique deals with both of these problems. (The latter seems to be dealt by trylocks (see __d_unalias), which look like t