From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: nfs@lists.sourceforge.net
Subject: Re: Question: When NFS client check dir's permission, it does not check the cache data
Date: Wed, 27 Jun 2007 09:24:20 +0800 [thread overview]
Message-ID: <4681BC44.6000605@cn.fujitsu.com> (raw)
In-Reply-To: <1182802099.6163.33.camel@heimdal.trondhjem.org>
>> Hello, everyone
>> When I test NFS client, I found a poblem that, if a dir we do not have
>> permission to write, it will let the server to check permissions when we
>> perform the write op.
>> This is comment by source code:
>> * Optimize away all write operations, since the server
>> * will check permissions when we perform the op.
>> In my test, the process is like following:
>> #touch dir/file
>> NFS Server NFS Client
>> <---------- lookup (dir)
>> lookup ok ------------->
>> <---------- access (dir) (*1)
>> access(read only) ----------->
>> <---------- lookup (file)
>> lookup(NOENT) ------------->
>> <---------- create (file) (*2)
>> create(NOPERM) ------------->
>>
>> (*1)
>> First to check the permissions of that dir ,and will be add to cache data.
>> (*2)
>> Since the Client had known the permission of the dir, why no used it?
>> Does this effect to NFS client's performance?
>>
>
> You could, but we don't really have good semantics for how to cache
> directory information. For files you have close-to-open caching, but for
> directories, there is no equivalent. I'd therefore prefer to be
> conservative in cases like this, rather than relying on cached
> information.
>
I think code "status = nfs_access_get_cached(inode, cred, &cache);" can do
this. And it works.
Other question: why only optimize all write operations, read operations
are not optimized? If read options is optimized, it can do the same things,
do not use access to check permissions, and server will check permissions
when we perform the read op.
> The other question I have is why this is really something worth
> optimising for? Are there really applications out there with a workload
> that involves lots of attempts to create files in read-only directories?
>
> Trond
>
Regards
Wei Yongjun
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2007-06-27 1:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-25 8:52 Question: When NFS client check dir's permission, it does not check the cache data Wei Yongjun
2007-06-25 18:09 ` Muntz, Daniel
2007-06-25 20:08 ` Trond Myklebust
2007-06-27 1:24 ` Wei Yongjun [this message]
2007-06-27 3:09 ` Trond Myklebust
2007-06-27 5:22 ` Wei Yongjun
2007-06-27 14:25 ` Trond Myklebust
2007-06-28 3:06 ` Wei Yongjun
2007-07-26 5:12 ` Wei Yongjun
2007-07-26 16:26 ` Trond Myklebust
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=4681BC44.6000605@cn.fujitsu.com \
--to=yjwei@cn.fujitsu.com \
--cc=nfs@lists.sourceforge.net \
--cc=trond.myklebust@fys.uio.no \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.