Commit c0a1d129 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

pNFS/flexfiles: Ensure we initialise the mirror bsizes correctly on read

While it is true that reading from an unmirrored source always uses
index 0, that is no longer true for mirrored sources when we fail over.

Fixes: 563c53e7 ("NFS: Fix flexfiles read failover")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 68274f97
...@@ -838,6 +838,7 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, ...@@ -838,6 +838,7 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
struct nfs4_ff_layout_mirror *mirror; struct nfs4_ff_layout_mirror *mirror;
struct nfs4_pnfs_ds *ds; struct nfs4_pnfs_ds *ds;
int ds_idx; int ds_idx;
u32 i;
retry: retry:
ff_layout_pg_check_layout(pgio, req); ff_layout_pg_check_layout(pgio, req);
...@@ -863,14 +864,14 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, ...@@ -863,14 +864,14 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
goto retry; goto retry;
} }
mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx); for (i = 0; i < pgio->pg_mirror_count; i++) {
mirror = FF_LAYOUT_COMP(pgio->pg_lseg, i);
pgm = &pgio->pg_mirrors[i];
pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize;
}
pgio->pg_mirror_idx = ds_idx; pgio->pg_mirror_idx = ds_idx;
/* read always uses only one mirror - idx 0 for pgio layer */
pgm = &pgio->pg_mirrors[0];
pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize;
if (NFS_SERVER(pgio->pg_inode)->flags & if (NFS_SERVER(pgio->pg_inode)->flags &
(NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR)) (NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR))
pgio->pg_maxretrans = io_maxretrans; pgio->pg_maxretrans = io_maxretrans;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment