pNFS/flexfiles: Don't time out requests on hard mounts

If the mount is hard, we should ignore the 'io_maxretrans' module
parameter so that we always keep retrying.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust 2019-08-23 08:37:50 -04:00
Родитель c82e5472c9
Коммит 7af46292da
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -8,6 +8,7 @@
*/ */
#include <linux/nfs_fs.h> #include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
#include <linux/nfs_page.h> #include <linux/nfs_page.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched/mm.h> #include <linux/sched/mm.h>
@ -928,7 +929,9 @@ retry:
pgm = &pgio->pg_mirrors[0]; pgm = &pgio->pg_mirrors[0];
pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize; pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize;
pgio->pg_maxretrans = io_maxretrans; if (NFS_SERVER(pgio->pg_inode)->flags &
(NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR))
pgio->pg_maxretrans = io_maxretrans;
return; return;
out_nolseg: out_nolseg:
if (pgio->pg_error < 0) if (pgio->pg_error < 0)
@ -940,6 +943,7 @@ out_mds:
pgio->pg_lseg); pgio->pg_lseg);
pnfs_put_lseg(pgio->pg_lseg); pnfs_put_lseg(pgio->pg_lseg);
pgio->pg_lseg = NULL; pgio->pg_lseg = NULL;
pgio->pg_maxretrans = 0;
nfs_pageio_reset_read_mds(pgio); nfs_pageio_reset_read_mds(pgio);
} }
@ -1000,7 +1004,9 @@ retry:
pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].wsize; pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].wsize;
} }
pgio->pg_maxretrans = io_maxretrans; if (NFS_SERVER(pgio->pg_inode)->flags &
(NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR))
pgio->pg_maxretrans = io_maxretrans;
return; return;
out_mds: out_mds:
@ -1010,6 +1016,7 @@ out_mds:
pgio->pg_lseg); pgio->pg_lseg);
pnfs_put_lseg(pgio->pg_lseg); pnfs_put_lseg(pgio->pg_lseg);
pgio->pg_lseg = NULL; pgio->pg_lseg = NULL;
pgio->pg_maxretrans = 0;
nfs_pageio_reset_write_mds(pgio); nfs_pageio_reset_write_mds(pgio);
} }