Miklos Szeredi <miklos@xxxxxxxxxx> writes: > Jordi Pujol <jordipujolp@xxxxxxxxx> writes: >> >> In my tests, locking the parent directories makes the right thing, >> but maybe there are other cases that should be considered... > > Can you please try the following patch then? Does any of the WARN_ONs > trigger when you observe the bad behavior? Jordi, what's up with this? Could you please test the .v8 codebase with this single patch applied? Thanks, Miklos > --- > fs/overlayfs/dir.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > Index: linux-2.6/fs/overlayfs/dir.c > =================================================================== > --- linux-2.6.orig/fs/overlayfs/dir.c 2011-05-10 18:13:03.000000000 +0200 > +++ linux-2.6/fs/overlayfs/dir.c 2011-05-10 18:16:13.000000000 +0200 > @@ -512,6 +512,9 @@ static int ovl_rename(struct inode *oldd > old_upperdir = ovl_dentry_upper(old->d_parent); > new_upperdir = ovl_dentry_upper(new->d_parent); > > + (void) dget(old_upperdir); > + (void) dget(new_upperdir); > + > trap = lock_rename(new_upperdir, old_upperdir); > > olddentry = ovl_dentry_upper(old); > @@ -571,6 +574,13 @@ static int ovl_rename(struct inode *oldd > dput(newdentry); > out_unlock: > unlock_rename(new_upperdir, old_upperdir); > + > + WARN_ON(old_upperdir->d_count == 1); > + WARN_ON(new_upperdir->d_count == 1); > + > + dput(old_upperdir); > + dput(new_upperdir); > + > return err; > } > -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html