Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 514654

Summary: nfsv4-server return NFS4ERR_BAD_STATEID, but return NFS4ERR_EXPIRED when it has invalid stateID
Product: Red Hat Enterprise Linux 5 Reporter: Wade Mealing <wmealing>
Component: kernelAssignee: Wade Mealing <wmealing>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: czhang, dzickus, jlayton, jwest, jwilson, qcai, rwheeler, steved, syeghiay, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 07:46:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 526950, 533192    
Attachments:
Description Flags
The attachment is a file, unix line endings, diff format.
none
Test case as shown in steps to reproudce. none

Description Wade Mealing 2009-07-30 02:17:15 UTC
Description of problem:


When nfsv4-client used expired stateid which generated 'lease_time' seconds ago,
nfsv4-server return NFS4ERR_BAD_STATEID, but according to RFC3530, nfsv4-server
should return NFS4ERR_EXPIRED in this case.


--
[RFC3530] 8.6.3.  Network Partitions and Recovery

If the duration of a network partition is greater than the lease
period provided by the server, the server will have not received a
lease renewal from the client.  If this occurs, the server may free
all locks held for the client.  As a result, all stateid held by the
client will become invalid or stale.  Once the client is able to
reach the server after such a network partition, all I/O submitted by
the client with the now invalid stateid will fail with the server
returning the error NFS4ERR_EXPIRED.
--


Version-Release number of selected component (if applicable):

Kernel 2.6.18-128

How reproducible:

Every time.

Steps to Reproduce:

Server:

0. mkdir -p /work/nfs
1. Add "/work/nfs *(rw,insecure,no_root_squash,fsid=0)" to /etc/exports
2. echo 90 > /proc/fs/nfsd/nfsv4leasetime
3.service nfs restart

0. mkdir -p /mnt/point
1. mount -t nfs4 server:/work/nfs /mnt/point
2. gcc -o nfs_test nfs_test.c
3. ./nfs_test serverip

Actual results:

Fail: CLOSE after lease timeout should return NFS4ERR_EXPIRED, instead got NFS4ERR_BAD_STATEID

Expected results:

Pass: CLOSE after lease timeout server return NFS4ERR_EXPIRED

Additional info:

I've done initial testing of this patch, it seems sane, ran it through the connectathon tests, no additional tests failed.

Comment 1 Wade Mealing 2009-07-30 02:45:30 UTC
Created attachment 355633 [details]
The attachment is a file, unix line endings, diff format.

Comment 2 Wade Mealing 2009-07-30 02:51:08 UTC
Created attachment 355634 [details]
Test case as shown in steps to reproudce.

Comment 4 RHEL Program Management 2009-09-25 17:35:26 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 22 errata-xmlrpc 2010-03-30 07:46:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0178.html