NFS: Fix a writeback race...
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 19 Oct 2007 21:26:11 +0000 (17:26 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Nov 2007 17:37:01 +0000 (09:37 -0800)
commit11170fcc31bde3c9752d9f4992a85ba1c05decaf
treeaf79642127f195681c176ced785432ef77ffb604
parent78fd2b3595b7c73b109154f1abe0f1d2b85dbbe6
NFS: Fix a writeback race...

patch 61e930a904966cc37e0a3404276f0b73037e57ca in mainline

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/write.c