linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Barry Naujok <bnaujok@sgi.com>
Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, aia21@cantab.net
Subject: Re: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache
Date: Tue, 13 May 2008 04:57:24 -0400	[thread overview]
Message-ID: <20080513085724.GC21919@infradead.org> (raw)
In-Reply-To: <20080513080152.911303131@chook.melbourne.sgi.com>

First please Cc Anton on this as he wrote the original version of
what's now d_add_ci, I suspect he might have some useful comments.


On Tue, May 13, 2008 at 05:57:52PM +1000, Barry Naujok wrote:
> Another unusual interaction with the dcache is not storing 
> negative dentries like other filesystems doing a d_add(dentry, NULL)
> when an ENOENT is returned. During the VFS lookup, if a dentry
> returned has no inode, dput is called and ENOENT is returned.
> By not doing a d_add, this actually removes it completely from
> the dcache to be reused.

That is a way to implement this correctly, but I suspect not creating
negative dentries will degrade performance quite badly on some
workloads.  Then again CI is useful only for samba serving where the
namecache on the client side should mitigate that effect.

We'd probably be better off long-term implementing Anton's earlier
suggestion to have a routine that purges all ci aliased negative
dentries on a successfull lookup.


> create/rename have to be modified to
> support unhashed dentries being passed in.




> +	if (ci_sfep)
> +		return XFS_ERROR(xfs_dir_cilookup_result(args,
> +					ci_sfep->name, ci_sfep->namelen));

Putting a function call inside XFS_ERROR is quite unreadable.  Should be
easy to fix as there's already an error variable in scope.


> @@ -1646,15 +1653,18 @@ xfs_lookup(
>  		return XFS_ERROR(EIO);
>  
>  	lock_mode = xfs_ilock_map_shared(dp);
> -	error = xfs_dir_lookup(NULL, dp, name, &inum);
> +	error = xfs_dir_lookup(NULL, dp, name, &inum, ci_match);
>  	xfs_iunlock_map_shared(dp, lock_mode);
>  
>  	if (error)
>  		goto out;
>  
>  	error = xfs_iget(dp->i_mount, NULL, inum, 0, 0, ipp, 0);
> -	if (error)
> +	if (error) {
> +		if (ci_match && *ci_match)
> +			kmem_free(name->name, name->len);
>  		goto out;

normal style would be to add a out_free_name label for this one to move
the error handling code into one place at the end of the function.

  reply	other threads:[~2008-05-13  8:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13  7:57 [PATCH 0/4] XFS: Case-insensitive support - ASCII only Barry Naujok
2008-05-13  7:57 ` [PATCH 1/4] XFS: Name operation vector for hash and compare Barry Naujok
2008-05-13  8:31   ` Christoph Hellwig
2008-05-13  7:57 ` [PATCH 2/4] XFS: add op_flags field and helpers to xfs_da_args Barry Naujok
2008-05-13  8:34   ` Christoph Hellwig
2008-05-14  6:12     ` Barry Naujok
2008-05-13  7:57 ` [PATCH 3/4] XFS: Return case-insensitive match for dentry cache Barry Naujok
2008-05-13  8:57   ` Christoph Hellwig [this message]
2008-05-14  6:15     ` Barry Naujok
2008-05-14  7:55     ` Barry Naujok
2008-05-15  4:57       ` Christoph Hellwig
2008-05-15  5:14         ` Barry Naujok
2008-05-15 13:43           ` Anton Altaparmakov
2008-05-15 14:11             ` Christoph Hellwig
2008-05-16  0:30               ` Barry Naujok
2008-05-16  7:25               ` Anton Altaparmakov
2008-05-20  2:24             ` Barry Naujok
2008-05-20 18:23               ` Christoph Hellwig
2008-05-20 20:50                 ` Sunil Mushran
2008-05-13  7:57 ` [PATCH 4/4] XFS: ASCII case-insensitive support Barry Naujok
2008-05-13  8:58   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-05-14  7:52 [PATCH 0/4] XFS: ASCII case-insensitivity support Barry Naujok
2008-05-14  7:52 ` [PATCH 3/4] XFS: Return case-insensitive match for dentry cache Barry Naujok

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=20080513085724.GC21919@infradead.org \
    --to=hch@infradead.org \
    --cc=aia21@cantab.net \
    --cc=bnaujok@sgi.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /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).