pNFS/filelayout: Specify the layout segment range in LAYOUTGET
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 20 Mar 2024 21:11:20 +0000 (17:11 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 20 May 2024 15:06:18 +0000 (11:06 -0400)
Move from only requesting full file layout segments to requesting layout
segments that match our I/O size. This means the server is still free to
return a full file layout if it wants, but partial layouts will no
longer cause an error.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/filelayout/filelayout.c

index 3fb18b16a5b4e3077b098c8fa78b0f7ee7351699..cc2ed4b5a4fd5ab95536d5b51312be3d163a85fd 100644 (file)
@@ -871,8 +871,8 @@ filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
        if (!pgio->pg_lseg) {
                pgio->pg_lseg = fl_pnfs_update_layout(pgio->pg_inode,
                                                      nfs_req_openctx(req),
-                                                     0,
-                                                     NFS4_MAX_UINT64,
+                                                     req_offset(req),
+                                                     req->wb_bytes,
                                                      IOMODE_READ,
                                                      false,
                                                      GFP_KERNEL);
@@ -895,8 +895,8 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
        if (!pgio->pg_lseg) {
                pgio->pg_lseg = fl_pnfs_update_layout(pgio->pg_inode,
                                                      nfs_req_openctx(req),
-                                                     0,
-                                                     NFS4_MAX_UINT64,
+                                                     req_offset(req),
+                                                     req->wb_bytes,
                                                      IOMODE_RW,
                                                      false,
                                                      GFP_NOFS);