linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jordi Pujol <jordipujolp@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: overlayfs patches for ovl_copy_up & ovl_rename
Date: Mon, 9 May 2011 08:38:04 +0200	[thread overview]
Message-ID: <201105090838.04534.jordipujolp@gmail.com> (raw)
In-Reply-To: <871v0da54v.fsf@tucsk.pomaz.szeredi.hu>

Hello,

A Dijous 05 Maig 2011 11:06:08, Miklos Szeredi va escriure:
> Looks good, but I'm only willing to look at performance issues after the
> bugs have been fixed.

This also locks the whole path before doing the copy, that could be better 
also, give it a try,
Pass me the list of pending bugs and I will help to debug, if I can

> > 
> >  	old_upperdir = ovl_dentry_upper(old->d_parent);
> >  	new_upperdir = ovl_dentry_upper(new->d_parent);
> > 
> > +	(void) dget(old_upperdir);
> > +	(void) dget(new_upperdir);
> > +
> 
> This should not be necessary.  vfs_rename() locks old and new parents
> which means taking an extra ref is totally superfluous.  If this does
> make some difference then there's something very sinister going on an we
> need to investigate further.
> 
> >  	trap = lock_rename(new_upperdir, old_upperdir);
> >  	
> >  	olddentry = ovl_dentry_upper(old);
> > 
> > -	newdentry = ovl_dentry_upper(new);
> > -	if (newdentry) {
> > -		dget(newdentry);
> > +	(void) dget(olddentry);
> 
> Again, while we have a ref on old, we should have a ref on olddentry as
> well, so this shouldn't make a difference.
> 
> > +

Maybe the key action is to take this reference as early as possible; 
consider that this really works, and it looks the same that is done by 
unionfs.

> > +	if (!ovl_is_whiteout(new) &&
> > +	(newdentry = ovl_dentry_upper(new))) {
> > +		(void) dget(newdentry);
> 
> This shouldn't make a difference either, ovl_dentry_upper() will return
> NULL for whiteouts.

Agree, this has not any impact on the final behaviour,

> Can you try introducing the above changes one by one to see which one,
> if any of them, makes a difference to your test case?
> 

In my tests, locking the parent directories makes the right thing,
but maybe there are other cases that should be considered...

Thanks,

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com

  reply	other threads:[~2011-05-09  6:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 14:59 overlayfs patches for ovl_copy_up & ovl_rename Jordi Pujol
2011-05-05  9:06 ` Miklos Szeredi
2011-05-09  6:38   ` Jordi Pujol [this message]
2011-05-10 16:20     ` Miklos Szeredi
2011-05-17  8:43       ` Miklos Szeredi
2011-05-17 17:18         ` Jordi Pujol
2011-05-17 18:07           ` Miklos Szeredi
2011-05-18  7:44             ` Jordi Pujol
2011-05-18  8:42               ` Miklos Szeredi
2011-05-19  7:47                 ` Jordi Pujol
2011-05-19  8:49                   ` Miklos Szeredi
2011-05-19  9:24                     ` Jordi Pujol
2011-05-19  9:52                       ` Miklos Szeredi
2011-05-19 13:34                         ` Jordi Pujol
2011-05-21  5:10                       ` Jordi Pujol
2011-05-23  9:21                         ` Miklos Szeredi
2011-05-24 15:53                           ` Jordi Pujol
2011-05-27 15:03                           ` Jordi Pujol
2011-05-31  9:01                             ` Miklos Szeredi
2011-05-19  8:52                   ` Jordi Pujol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105090838.04534.jordipujolp@gmail.com \
    --to=jordipujolp@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).