Bug 1211013 - NFS client mounted via flex-files layout reads past EOF if O_DIRECT and block size >= 512k
Summary: NFS client mounted via flex-files layout reads past EOF if O_DIRECT and block...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: nfs-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: Flexfile layouts
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-12 06:06 UTC by Jean Spector
Modified: 2015-05-03 17:22 UTC (History)
8 users (show)

Fixed In Version: kernel-4.0.1-300.fc22
Clone Of:
Environment:
Last Closed: 2015-04-30 13:57:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Network traces with EOF (2.76 MB, application/octet-stream)
2015-04-12 06:06 UTC, Jean Spector
no flags Details

Description Jean Spector 2015-04-12 06:06:55 UTC
Created attachment 1013565 [details]
Network traces with EOF

Description of problem:
NFS client mounted using flex-files layout reads past EOF (forever) if both conditions are true:

* open O_DIRECT
* block size >= 512k

Version-Release number of selected component (if applicable):
* Client fedora rawhide 4.0.0-0.rc5.git4.1.fc23.x86_64
* Primary Data MDS b630 3.11.9-integration-630-90182a7f

How reproducible:
Every time

Steps to Reproduce:
> mount pd-mds:/share1 /mnt/test
> perl -e 'print "x" x 1048576' > /mnt/test/jean-test
> dd bs=512k of=/dev/null if=/mnt/test/jean-test iflag=direct

Actual results:
The client keeps "reading" forever or until the target fills up.
Note that the client is writing the last chunk it read continuously to the output file, even though it gets 0 bytes on subsequent reads.

Expected results:
The client stops reading upon reaching EOF

Additional info:
* I see partial reads being reported, but adding iflag=fullblock doesn't change the behavior (but removes the warning)
* Mount options
> pd-mds:/share1 on /mnt/test type nfs4 (rw,relatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=X.X.X.X,local_lock=none,addr=Y.Y.Y.Y)
* Network traces attached

Comment 1 Jean Spector 2015-04-16 05:43:45 UTC
Fixing patch: http://www.spinics.net/lists/linux-nfs/msg50654.html

Comment 2 Josh Boyer 2015-04-21 12:19:21 UTC
That patch has been sitting uncommented on a for a while now.  I poked the upstream thread to see if why.

Out of curiosity, did you happen to build a kernel with those and test?

Comment 3 Josh Boyer 2015-04-27 13:26:02 UTC
OK, this patch finally went upstream.  It should be in the 4.1-rc1 build today.

Comment 4 Josh Boyer 2015-04-27 15:15:46 UTC
Fixed in rawhide and in git for F22.

Comment 5 Jean Spector 2015-04-29 15:06:35 UTC
Verified on rawhide running kernel 4.1.0-0.rc1.git0.1.fc23.x86_64

Comment 6 Fedora Update System 2015-04-30 12:25:00 UTC
kernel-4.0.1-300.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/kernel-4.0.1-300.fc22

Comment 7 Fedora Update System 2015-05-03 17:22:31 UTC
kernel-4.0.1-300.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.