lkml.org 
[lkml]   [2010]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 01/10] ovl: small optimisation for ovl_lookup
From
Date
On Mon, 06 Sep 2010, NeilBrown wrote:
> If we find a non-directory in the upper layer, there is no point
> performing a lookup in the lower layer as whatever is found will just
> be ignored anyway.
>
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
> fs/overlayfs/overlayfs.c | 17 ++++++++---------
> 1 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
> index 0fe3944..0ddfeec 100644
> --- a/fs/overlayfs/overlayfs.c
> +++ b/fs/overlayfs/overlayfs.c
> @@ -495,7 +495,8 @@ static struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
> dput(upperdentry);
> upperdentry = NULL;
> ue->opaque = true;
> - }
> + } else if (!S_ISDIR(upperdentry->d_inode->i_mode))
> + ue->opaque = true;

Setting opaque unconditionally, without checking whether the lower
file exists or not, means on unlink we'll create a whiteout even when
not necessary.

Thanks,
Miklos


\
 
 \ /
  Last update: 2010-09-06 19:01    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site