Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 134877 Details for
Bug 197264
[2.6.23 regression] NFS data corruption
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
possible fix
nfs.patch (text/plain), 2.38 KB, created by
Daniel Drake (RETIRED)
on 2007-11-01 11:01:33 UTC
(
hide
)
Description:
possible fix
Filename:
MIME Type:
Creator:
Daniel Drake (RETIRED)
Created:
2007-11-01 11:01:33 UTC
Size:
2.38 KB
patch
obsolete
>From: Trond Myklebust <Trond.Myklebust@netapp.com> >Date: Thu, 18 Oct 2007 21:08:05 +0000 (-0400) >Subject: NFS: Fix a writeback race... >X-Git-Tag: v2.6.24-rc1~133^2~3 >X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=61e930a904966cc37e0a3404276f0b73037e57ca > >NFS: Fix a writeback race... > >This patch fixes a regression that was introduced by commit >44dd151d5c21234cc534c47d7382f5c28c3143cd > >We cannot zero the user page in nfs_mark_uptodate() any more, since > > a) We'd be modifying the page without holding the page lock > b) We can race with other updates of the page, most notably > because of the call to nfs_wb_page() in nfs_writepage_setup(). > >Instead, we do the zeroing in nfs_update_request() if we see that we're >creating a request that might potentially be marked as up to date. > >Thanks to Olivier Paquet for reporting the bug and providing a test-case. > >Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> >--- > >diff --git a/fs/nfs/write.c b/fs/nfs/write.c >index 0cf9d1c..89527a4 100644 >--- a/fs/nfs/write.c >+++ b/fs/nfs/write.c >@@ -174,8 +174,6 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int > return; > if (count != nfs_page_length(page)) > return; >- if (count != PAGE_CACHE_SIZE) >- zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0); > SetPageUptodate(page); > } > >@@ -627,7 +625,8 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx, > return ERR_PTR(error); > } > spin_unlock(&inode->i_lock); >- return new; >+ req = new; >+ goto zero_page; > } > spin_unlock(&inode->i_lock); > >@@ -655,13 +654,23 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx, > if (offset < req->wb_offset) { > req->wb_offset = offset; > req->wb_pgbase = offset; >- req->wb_bytes = rqend - req->wb_offset; >+ req->wb_bytes = max(end, rqend) - req->wb_offset; >+ goto zero_page; > } > > if (end > rqend) > req->wb_bytes = end - req->wb_offset; > > return req; >+zero_page: >+ /* If this page might potentially be marked as up to date, >+ * then we need to zero any uninitalised data. */ >+ if (req->wb_pgbase == 0 && req->wb_bytes != PAGE_CACHE_SIZE >+ && !PageUptodate(req->wb_page)) >+ zero_user_page(req->wb_page, req->wb_bytes, >+ PAGE_CACHE_SIZE - req->wb_bytes, >+ KM_USER0); >+ return req; > } > > int nfs_flush_incompatible(struct file *file, struct page *page)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197264
: 134877