Summary: | [nfs] FreeBSD 9.1 nfs client dirlist problem w/ nfsv3,rsize=4096,wsize=4096 | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Mihai M. <mmihai> | ||||
Component: | kern | Assignee: | Rick Macklem <rmacklem> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | krichy, rmacklem | ||||
Priority: | Normal | Flags: | rmacklem:
mfc-stable10+
rmacklem: mfc-stable9+ |
||||
Version: | 9.1-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Mihai M.
2013-04-19 07:00:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s). This still exists in releng/10.2. Any solutions? I've noticed difference between mounting with wsize and without wsize: # mount -o rsize=2048 10.0.0.2:/home/kh /home/kh/ root@freebsd9:~ # ls -1 /home/kh/fenykepek/20110429 | sort | uniq | wc -l 309 # umount /home/kh/ # mount -o rsize=2048,wsize=2048 10.0.0.2:/home/kh /home/kh/ # ls -1 /home/kh/fenykepek/20110429 | sort | uniq | wc -l 225 Dont know if this helps. Created attachment 162553 [details]
patch to fix this problem
I think this patch will fix the problem. When f_iosize
which sets bo_bsize is less than the size of a buffer
cache buffer problems occur. NFS_DIRBLKSIZ (8K) is the
size of the buffer cache blocks used for directories and
without this patch, rsize=4096 would set f_iosize->bo_bsize
to 4096.
I think the attached patch fixes the problem, which I believe woudl only occur when rsize was set to less than NFS_DIRBLKSIZ (8K). Seems that for my simple test case it works, it gaves the expected directory listing. A commit references this bug: Author: rmacklem Date: Tue Nov 17 01:44:26 UTC 2015 New revision: 290970 URL: https://svnweb.freebsd.org/changeset/base/290970 Log: mnt_stat.f_iosize (which is used to set bo_bsize) must be set to the largest size of buffer cache block or the mapping of the buffer is bogus. When a mount with rsize=4096,wsize=4096 was done, f_iosize would be set to 4096. This resulted in corrupted directory data, since the buffer cache block size for directories is NFS_DIRBLKSIZ (8192). This patch fixes the code so that it always sets f_iosize to at least NFS_DIRBLKSIZ. Tested by: krichy@cflinux.hu PR: 177971 MFC after: 2 weeks Changes: head/sys/fs/nfsclient/nfs_clvfsops.c The patch that fixes this has been committed to stable/10 as r291551 and stable/9 as r291552. |