J.R,

On Fri, Dec 18, 2009 at 12:07 AM,  <[email protected]> wrote:
> Daire Byrne:
>> I understand that the readirplus calls are necessary to list the dir
>> contents and make the union. Looking at the traffic more closely in
>> wireshark I see that there are a few readdirplus calls first to get
>> the contents of a single directory and if I do an "ls -l" (stat)
>> actually most of the traffic is then NFS "LOOKUP" calls/replies (one
>> for each file in the dir). Is this traffic required? I mean if we now
>> know the contents of the dir and I always want to use the file in the
>> top branch then why stat the lower branch files at all if they exist
>> in the top branch? Could this be disabled?
>
> LOOKUP is issued in readdir in NFS, I think.
> Try wireshark and "ls -l /your/nfs/directly".

When I looked it seems like "ls" triggered just the readdirplus calls
without the lookups. Perhaps you need to check the inodes or mtimes of
the lower branch even if the (same) files are all in the top branch?

>> Also for the case when doing blind open() calls on files is it not
>> possible to try open from the top branch and only if it fails do a
>> lookup on the lower (NFS) branch? Again looking at the wireshark
>> output when I open a file in a dirtree it looks like there are LOOKUP
>> and ACCESS calls being made to each directory in the tree. But the
>> tree exists on the top branch so why can't we ignore the lower NFS
>> tree unless the file/dirs don't exist?
>
> If you access a dir in aufs, aufs accesses every branch.
> If it is a non-dir, aufs searches the first one only.
> You may want the 'dirperm1' aufs option for the dir. But it is dropped
> in aufs2.

Yes that could explain that one.

> If you really stop aufs accessing your lower NFS branch, then you should
> create a file named ".wh..wh.opq" in all directories on the upper
> branch. It tells aufs that the dir is "opaque" and aufs will not search
> the lower dir.

Oops - I completely missed this functionality. I can probably write
some logic to create these files where I need them - thanks. It isn't
as flexible as just letting aufs union every dir but at least it does
get rid of all the slow NFS calls.

One last little thing. I can run processes against the aufs branch and
then add branches on the fly without mount complaining but if I try
remove a branch (when running a "find" against the union say) then
mount won't let me remove the branch because it is "in use". Is there
a way to forcibly remove the branch and return an error to the process
that is keeping it open? I would like to be able to pull down the NFS
bottom branch at anytime regardless of what is running (like when
bringing down the network/vpn).

Daire

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

Reply via email to