7782 nfs: READDIR for referrals should conform to RFC 7530

Review Request #436 - Created April 21, 2017 and submitted

Information
Vitaliy Gusev
illumos-gate
master
7782
4e81d4e...
Reviewers
general

7782 nfs: READDIR for referrals should conform to RFC 7530

This patch add returning error for whole READDIR operation if rdattr_error wasn't requested and:
- met referral
- any other error occured during getting attributes (it could be permission denied, for instance).

The patch intensionally misses first part of 8.3.2: returning success if fs_locations is set.

For more information look at Section 16.24.4:

"In some cases, the server may encounter an error while obtaining the
attributes for a directory entry..."

With Linux 4.8.5 kernel and vSphere-6.3. Both works fine.

For testing:

  1. Create nfs referral via nfsref: nfsref add somename 192.168.1.1:/data
  2. Do ls in directory that contains referral.

Linux client sends READDIR with rdattr_error attribute, but vSphere doesn't.

Before patch for vSphere client:
READDIR reply contains directory entry (that is referral) with empty attributes, i.e. w/o previously requested attributes.

After pathch for vSphere client:
READDIR reply with error NFS4ERR_MOVED, i.e. whole READDIR operation fails.

ADDITIONAL TESTING BY PYNFS WITH patched nfssrv (Revision/Changeset #10) and original nfssrv. As result: no regression errors. Additionally pynfs fslocations test reported better results (more PASS-ed tests).


PATCHED
./testserver.py 10.42.0.15:/codepool/data/test --rundep readdir


INIT st_setclientid.testValid : PASS
LOOKBLK st_lookup.testBlock : PASS
LOOKCHAR st_lookup.testChar : PASS
LOOKFIFO st_lookup.testFifo : PASS
LOOKFILE st_lookup.testFile : PASS
LOOKLINK st_lookup.testLink : PASS
LOOKSOCK st_lookup.testSocket : PASS
MKDIR st_create.testDir : PASS
MKFILE st_open.testOpen : PASS
MODE st_setattr.testMode : PASS
RDDR1 st_readdir.testEmptyDir : PASS
RDDR2 st_readdir.testFirst : PASS
RDDR3 st_readdir.testAttr : PASS
RDDR4 st_readdir.testSubsequent : PASS
RDDR5a st_readdir.testFhLink : PASS
RDDR5b st_readdir.testFhBlock : PASS
RDDR5c st_readdir.testFhChar : PASS
RDDR5f st_readdir.testFhFifo : PASS
RDDR5r st_readdir.testFhFile : PASS
RDDR5s st_readdir.testFhSocket : PASS
RDDR6 st_readdir.testNoFh : PASS
RDDR7 st_readdir.testMaxcountZero : PASS
RDDR8 st_readdir.testMaxcountSmall : FAILURE
READDIR of empty dir with maxcount=16 should return
NFS4_OK, instead got NFS4ERR_TOOSMALL
RDDR9 st_readdir.testWriteOnlyAttributes : PASS
RDDR10 st_readdir.testReservedCookies : FAILURE
READDIR with reserved cookie=1 should return
NFS4ERR_BAD_COOKIE, instead got NFS4_OK
RDDR11 st_readdir.testUnaccessibleDir : PASS
RDDR12 st_readdir.testUnaccessibleDirAttrs : PASS


Command line asked for 27 of 669 tests
Of those: 0 Skipped, 2 Failed, 0 Warned, 25 Passed


PATCHED
./testserver.py 10.42.0.15:/codepool/data/test --usespecial=/codepool/data/test/dir_00 --rundep fslocations


FSLOC1 st_fslocations.testReference : PASS
FSLOC2 st_fslocations.testReference2 : PASS
FSLOC3 st_fslocations.testReference3 : PASS
FSLOC4a st_fslocations.testAttr1a : FAILURE
GETATTR w/o FSLOC or RDATTR_ERROR should return
NFS4ERR_MOVED, instead got NFS4_OK
FSLOC4b st_fslocations.testAttr1b : PASS
FSLOC5a st_fslocations.testAttr2a : FAILURE
GETATTR w/o FSLOC but with RDATTR_ERROR should return
NFS4ERR_MOVED, instead got NFS4_OK
FSLOC5b st_fslocations.testAttr2b : PASS
FSLOC6a st_fslocations.testAttr3a : PASS
FSLOC6b st_fslocations.testAttr3b : PASS
FSLOC7a st_fslocations.testAttr4a : FAILURE
Expected 3 attrs returned, got 5
FSLOC7b st_fslocations.testAttr4b : PASS
FSLOC8a st_fslocations.testAttr5a : FAILURE
Expected 3 attrs returned, got 4
FSLOC8b st_fslocations.testAttr5b : PASS
GATT8 st_getattr.testFSLocations : PASS
LOOKFILE st_lookup.testFile : PASS


Command line asked for 15 of 669 tests
Of those: 0 Skipped, 4 Failed, 0 Warned, 11 Passed

----------------------------------------------------------------------------

ORIGINAL
./testserver.py 10.42.0.15:/codepool/data/test --usespecial=/codepool/data/test/dir_00 --rundep fslocations


FSLOC1 st_fslocations.testReference : PASS
FSLOC2 st_fslocations.testReference2 : PASS
FSLOC3 st_fslocations.testReference3 : PASS
FSLOC4a st_fslocations.testAttr1a : FAILURE
GETATTR w/o FSLOC or RDATTR_ERROR should return
NFS4ERR_MOVED, instead got NFS4_OK
FSLOC4b st_fslocations.testAttr1b : FAILURE
READDIR w/o FSLOC or RDATTR_ERROR should return
NFS4ERR_MOVED, instead got NFS4_OK
FSLOC5a st_fslocations.testAttr2a : FAILURE
GETATTR w/o FSLOC but with RDATTR_ERROR should return
NFS4ERR_MOVED, instead got NFS4_OK
FSLOC5b st_fslocations.testAttr2b : FAILURE
Expected 2 attrs returned for file dir_00, got 1
FSLOC6a st_fslocations.testAttr3a : PASS
FSLOC6b st_fslocations.testAttr3b : FAILURE
Expected 3 attrs returned for file dir_00, got 2
FSLOC7a st_fslocations.testAttr4a : FAILURE
Expected 3 attrs returned, got 5
FSLOC7b st_fslocations.testAttr4b : FAILURE
Expected 3 attrs returned for file dir_00, got 1
FSLOC8a st_fslocations.testAttr5a : FAILURE
Expected 3 attrs returned, got 4
FSLOC8b st_fslocations.testAttr5b : FAILURE
Expected 2 attrs returned for file dir_00, got 0
GATT8 st_getattr.testFSLocations : PASS
LOOKFILE st_lookup.testFile : PASS


Command line asked for 15 of 669 tests
Of those: 0 Skipped, 9 Failed, 0 Warned, 6 Passed


ORIGINAL

./testserver.py 10.42.0.15:/codepool/data/dir_test --rundep readdir


INIT st_setclientid.testValid : PASS
LOOKBLK st_lookup.testBlock : PASS
LOOKCHAR st_lookup.testChar : PASS
LOOKFIFO st_lookup.testFifo : PASS
LOOKFILE st_lookup.testFile : PASS
LOOKLINK st_lookup.testLink : PASS
LOOKSOCK st_lookup.testSocket : PASS
MKDIR st_create.testDir : PASS
MKFILE st_open.testOpen : PASS
MODE st_setattr.testMode : PASS
RDDR1 st_readdir.testEmptyDir : PASS
RDDR2 st_readdir.testFirst : PASS
RDDR3 st_readdir.testAttr : PASS
RDDR4 st_readdir.testSubsequent : PASS
RDDR5a st_readdir.testFhLink : PASS
RDDR5b st_readdir.testFhBlock : PASS
RDDR5c st_readdir.testFhChar : PASS
RDDR5f st_readdir.testFhFifo : PASS
RDDR5r st_readdir.testFhFile : PASS
RDDR5s st_readdir.testFhSocket : PASS
RDDR6 st_readdir.testNoFh : PASS
RDDR7 st_readdir.testMaxcountZero : PASS
RDDR8 st_readdir.testMaxcountSmall : FAILURE
READDIR of empty dir with maxcount=16 should return
NFS4_OK, instead got NFS4ERR_TOOSMALL
RDDR9 st_readdir.testWriteOnlyAttributes : PASS
RDDR10 st_readdir.testReservedCookies : FAILURE
READDIR with reserved cookie=1 should return
NFS4ERR_BAD_COOKIE, instead got NFS4_OK
RDDR11 st_readdir.testUnaccessibleDir : PASS
RDDR12 st_readdir.testUnaccessibleDirAttrs : PASS


Command line asked for 27 of 669 tests
Of those: 0 Skipped, 2 Failed, 0 Warned, 25 Passed


Issues

  • 0
  • 14
  • 5
  • 19
Description From Last Updated
Marcel Telka
Vitaliy Gusev
Vitaliy Gusev
Marcel Telka
Vitaliy Gusev
Vitaliy Gusev
Vitaliy Gusev
Toomas Soome
Toomas Soome
Marcel Telka
Vitaliy Gusev
Marcel Telka
Vitaliy Gusev
Vitaliy Gusev
Toomas Soome
Vitaliy Gusev
Toomas Soome
Gergő Mihály Doma
Gergő Mihály Doma
Gergő Mihály Doma
Gergő Mihály Doma
Gergő Mihály Doma
Vitaliy Gusev
Gergő Mihály Doma
Dan McDonald
Vitaliy Gusev
Dan McDonald
Vitaliy Gusev
Dan McDonald
Toomas Soome
Gergő Mihály Doma
Vitaliy Gusev
Vitaliy Gusev
Toomas Soome
Vitaliy Gusev
Vitaliy Gusev
Review request changed

Status: Closed (submitted)

Loading...