From 91e2a39944773e0aa3f799b988ad6acb26e3b8b5 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Sun, 22 May 2011 19:47:46 +0300 Subject: [PATCH] --- yaml --- r: 252893 b: refs/heads/master c: 707ed5fdb587c71fdb7ad224ba1d80231f33c974 h: refs/heads/master i: 252891: b86c0820ad2cfbc7e8c766954b97824f78b09d96 v: v3 --- [refs] | 2 +- trunk/fs/nfs/pnfs.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 034653de520c..e3d1175d8a26 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb3296eb4636763918edef2d22e45b85b15d4518 +refs/heads/master: 707ed5fdb587c71fdb7ad224ba1d80231f33c974 diff --git a/trunk/fs/nfs/pnfs.c b/trunk/fs/nfs/pnfs.c index c2f09e9b670e..2357ee343f4a 100644 --- a/trunk/fs/nfs/pnfs.c +++ b/trunk/fs/nfs/pnfs.c @@ -850,6 +850,7 @@ pnfs_update_layout(struct inode *ino, .offset = pos, .length = count, }; + unsigned pg_offset; struct nfs_inode *nfsi = NFS_I(ino); struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; struct pnfs_layout_hdr *lo; @@ -899,6 +900,13 @@ pnfs_update_layout(struct inode *ino, spin_unlock(&clp->cl_lock); } + pg_offset = arg.offset & ~PAGE_CACHE_MASK; + if (pg_offset) { + arg.offset -= pg_offset; + arg.length += pg_offset; + } + arg.length = PAGE_CACHE_ALIGN(arg.length); + lseg = send_layoutget(lo, ctx, &arg, gfp_flags); if (!lseg && first) { spin_lock(&clp->cl_lock);