2006-05-15 15:36:55

by Xin Zhao

[permalink] [raw]
Subject: NFS readdir problem

Hi,

I use NFS to read a remote directory, which contains 56 entries. But
after the read, "ls -al" only show 26, 31, or 51 entries in three test
runs.

I have read the NFS code "encode_entry" and related "nfs_readdir",
"nfs3_proc_readdir"..., but haven't find the right place that can
cause this problem.

Is there anyone has similar experience? Please help!

Thanks,
-x


2006-05-15 16:18:53

by Richard Mittendorfer

[permalink] [raw]
Subject: Re: NFS readdir problem

Also sprach "Xin Zhao" <[email protected]> (Mon, 15 May 2006 11:36:53
-0400):
> Hi,

Hello,

> I use NFS to read a remote directory, which contains 56 entries. But
> after the read, "ls -al" only show 26, 31, or 51 entries in three test
> runs.
>
> I have read the NFS code "encode_entry" and related "nfs_readdir",
> "nfs3_proc_readdir"..., but haven't find the right place that can
> cause this problem.
>
> Is there anyone has similar experience? Please help!

There is a note in the performance section from the NFS-HOWTO[1]. It
suggests adjusting the r- and wsize mount parameters:

_._. .._ _ .... . ._. . __..__ _._. .._ _ .... . ._. .

Directly after mounting with a larger size, cd into the mounted file
system and do things like ls, explore the filesystem a bit to make sure
everything is as it should. If the rsize/wsize is too large the
symptoms are very odd and not 100% obvious. A typical symptom is
incomplete file lists when doing ls, and no error messages, or reading
files failing mysteriously with no error messages. After establishing
that the given rsize/ wsize works you can do the speed tests again.
Different server platforms are likely to have different optimal sizes.
_._. .._ _ .... . ._. . __..__ _._. .._ _ .... . ._. .

[1] http://www.tldp.org
> Thanks,
> -x

sl ritch

2006-05-15 19:10:32

by Matthew Wilcox

[permalink] [raw]
Subject: Re: NFS readdir problem

On Mon, May 15, 2006 at 11:36:53AM -0400, Xin Zhao wrote:
> I use NFS to read a remote directory, which contains 56 entries. But
> after the read, "ls -al" only show 26, 31, or 51 entries in three test
> runs.
>
> I have read the NFS code "encode_entry" and related "nfs_readdir",
> "nfs3_proc_readdir"..., but haven't find the right place that can
> cause this problem.
>
> Is there anyone has similar experience? Please help!

I don't know the answer ... but you could do a little more to help:

- What's the server?
- What's the client?
- Exact versions of OS/kernel running on each

If you're really enthusiastic, you could run tcpdump and look at the
traces to see what filenames are actually being transported across.