2024-03-20 21:11:24

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v1 0/2] pNFS/filelayout: Enable partial layout support

From: Anna Schumaker <[email protected]>

These patches are heavily based on Trond's patches from April 2020 that
added partial layout support to the flexfile layout. As far as I can
tell, the pieces are already there we just need to change the filelayout
code to be okay with partial layouts.

Thanks,
Anna

Anna Schumaker (2):
pNFS/filelayout: Remove the whole file layout requirement
pNFS/filelayout: Specify the layout segment range in LAYOUTGET

fs/nfs/filelayout/filelayout.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

--
2.44.0



2024-03-20 21:11:27

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v1 1/2] pNFS/filelayout: Remove the whole file layout requirement

From: Anna Schumaker <[email protected]>

Layout segments have been supported in pNFS for years, so remove the
requirement that the server always sends whole file layouts.

Signed-off-by: Anna Schumaker <[email protected]>
---
fs/nfs/filelayout/filelayout.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index ce8f8934bca5..3fb18b16a5b4 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -605,14 +605,6 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,

dprintk("--> %s\n", __func__);

- /* FIXME: remove this check when layout segment support is added */
- if (lgr->range.offset != 0 ||
- lgr->range.length != NFS4_MAX_UINT64) {
- dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
- __func__);
- goto out;
- }
-
if (fl->pattern_offset > lgr->range.offset) {
dprintk("%s pattern_offset %lld too large\n",
__func__, fl->pattern_offset);
--
2.44.0


2024-03-20 21:11:28

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH v1 2/2] pNFS/filelayout: Specify the layout segment range in LAYOUTGET

From: Anna Schumaker <[email protected]>

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 <[email protected]>
---
fs/nfs/filelayout/filelayout.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 3fb18b16a5b4..cc2ed4b5a4fd 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -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);
--
2.44.0