Steve Dickson wrote:
Well the patch in question is: commit 1de3fc12ea085690547a54b6efa01c7348f1cebd tree ea865786120cfcefac563c54693fef8d3d718f10 parent 128e6ced247cda88f96fa9f2e4ba8b2c4a681560 author Trond Myklebust <Trond.Myklebust@xxxxxxxxxx> Thu, 25 May 2006 09:40:44 -0400 committer Trond Myklebust <Trond.Myklebust@xxxxxxxxxx> Fri, 09 Jun 2006 17:34:03 -0400 NFS: Clean up and fix page zeroing when we have short reads
Attached is that patch that fixes the regression caused by the above patch... I've tested with both the connectathon test suite and the fsx test suite. The patch is based on the 2.6.18-rc4 kernel tree. steved.
The patch fixes a regression that causes the special tests of the Connectation tests suite to fail. When a hole in a file is created (like the holey test does), the page will be allocated but there will be nothing read into it. The means the number of byte read from the server will be zero (i.e. data->res.count). In the case, the page still has PageUptodate-ed which is what this patch does. Signed-off-by: Steve Dickson <steved@xxxxxxxxxx> --- linux-2.6.18-rc4/fs/nfs/read.c.orig 2006-08-20 13:49:22.000000000 -0400 +++ linux-2.6.18-rc4/fs/nfs/read.c 2006-08-20 13:58:59.000000000 -0400 @@ -476,13 +476,14 @@ unsigned int base = data->args.pgbase; struct page **pages; - if (unlikely(count == 0)) - return; pages = &data->args.pages[base >> PAGE_CACHE_SHIFT]; base &= ~PAGE_CACHE_MASK; count += base; - for (;count >= PAGE_CACHE_SIZE; count -= PAGE_CACHE_SIZE, pages++) + if (count == 0) SetPageUptodate(*pages); + else + for (;count >= PAGE_CACHE_SIZE; count -= PAGE_CACHE_SIZE, pages++) + SetPageUptodate(*pages); /* * Was this an eof or a short read? If the latter, don't mark the page * as uptodate yet.