aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/pnfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c2f09e9b670e..2357ee343f4a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -850,6 +850,7 @@ pnfs_update_layout(struct inode *ino,
850 .offset = pos, 850 .offset = pos,
851 .length = count, 851 .length = count,
852 }; 852 };
853 unsigned pg_offset;
853 struct nfs_inode *nfsi = NFS_I(ino); 854 struct nfs_inode *nfsi = NFS_I(ino);
854 struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; 855 struct nfs_client *clp = NFS_SERVER(ino)->nfs_client;
855 struct pnfs_layout_hdr *lo; 856 struct pnfs_layout_hdr *lo;
@@ -899,6 +900,13 @@ pnfs_update_layout(struct inode *ino,
899 spin_unlock(&clp->cl_lock); 900 spin_unlock(&clp->cl_lock);
900 } 901 }
901 902
903 pg_offset = arg.offset & ~PAGE_CACHE_MASK;
904 if (pg_offset) {
905 arg.offset -= pg_offset;
906 arg.length += pg_offset;
907 }
908 arg.length = PAGE_CACHE_ALIGN(arg.length);
909
902 lseg = send_layoutget(lo, ctx, &arg, gfp_flags); 910 lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
903 if (!lseg && first) { 911 if (!lseg && first) {
904 spin_lock(&clp->cl_lock); 912 spin_lock(&clp->cl_lock);