Bug 885743

Summary: data corrupt when file modified by client and server continuously
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gansalmon, itamar, jiali, jlayton, jonathan, kernel-maint, madhu.chinakonda, nfs-maint, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 885536 Environment:
Last Closed: 2012-12-11 12:13:29 UTC Type: Bug
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: 885536    
Bug Blocks:    
Attachments:
Description Flags
patch -- don't extend writes to cover entire page when pagecache is invalid none

Description Jeff Layton 2012-12-10 14:11:32 UTC
+++ This bug was initially created as a clone of Bug #885536 +++

Description of problem:
A file is modified by client and server continuously, and data is not sync.

# mount localhost:/export /mntpath

# echo abc > /mntpath/file
# echo def >> /export/file
# echo ghi >> /mntpath/file

Then I check this file, data is like this:
abc\n\0\0\0\0ghi\n


Even when I use nfsv3, either i 'sync' after writing 'def' on server side.

Comment 1 Jeff Layton 2012-12-10 14:13:50 UTC
Created attachment 660887 [details]
patch -- don't extend writes to cover entire page when pagecache is invalid

Jian, this patch seems to fix the bug for me. Can you confirm whether it does for you?

Comment 2 Jian Li 2012-12-11 03:24:15 UTC
(In reply to comment #1)
> Created attachment 660887 [details]
> patch -- don't extend writes to cover entire page when pagecache is invalid
> 
> Jian, this patch seems to fix the bug for me. Can you confirm whether it
> does for you?

OK, I would check it.

Comment 3 Jeff Layton 2012-12-11 12:13:29 UTC
Patch sent to Trond and he's taken it into his bugfixes branch. It should get merged early in 3.8 and go into stable kernels soon after. I'll go ahead and close this with a resolution of UPSTREAM.

Comment 4 Jian Li 2012-12-13 09:22:19 UTC
This patch is tested on 3.6.0-0.29.el7, bug resolved.