diff options
author | Tom Haynes <loghyr@primarydata.com> | 2016-05-17 12:28:38 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-05-17 15:48:08 -0400 |
commit | 446ca2195303c550b1cec7dcf9a478910dc84672 (patch) | |
tree | 9ae689391011a18e65ec58568ca33e4cb466cbc4 /fs/nfs/flexfilelayout | |
parent | 3b13b4b311a508a5899070936a873e30fcc96a2f (diff) |
pNFS/flexfiles: When initing reads or writes, we might have to retry connecting to DSes
If we are initializing reads or writes and can not connect to a DS, then
check whether or not IO is allowed through the MDS. If it is allowed,
reset to the MDS. Else, fail the layout segment and force a retry
of a new layout segment.
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/flexfilelayout')
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index a835b75f85ab..2911ceda8cd9 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -848,8 +848,13 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, | |||
848 | goto out_mds; | 848 | goto out_mds; |
849 | 849 | ||
850 | ds = ff_layout_choose_best_ds_for_read(pgio->pg_lseg, 0, &ds_idx); | 850 | ds = ff_layout_choose_best_ds_for_read(pgio->pg_lseg, 0, &ds_idx); |
851 | if (!ds) | 851 | if (!ds) { |
852 | goto out_mds; | 852 | if (ff_layout_no_fallback_to_mds(pgio->pg_lseg)) |
853 | goto out_pnfs; | ||
854 | else | ||
855 | goto out_mds; | ||
856 | } | ||
857 | |||
853 | mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx); | 858 | mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx); |
854 | 859 | ||
855 | pgio->pg_mirror_idx = ds_idx; | 860 | pgio->pg_mirror_idx = ds_idx; |
@@ -863,6 +868,12 @@ out_mds: | |||
863 | pnfs_put_lseg(pgio->pg_lseg); | 868 | pnfs_put_lseg(pgio->pg_lseg); |
864 | pgio->pg_lseg = NULL; | 869 | pgio->pg_lseg = NULL; |
865 | nfs_pageio_reset_read_mds(pgio); | 870 | nfs_pageio_reset_read_mds(pgio); |
871 | return; | ||
872 | |||
873 | out_pnfs: | ||
874 | pnfs_set_lo_fail(pgio->pg_lseg); | ||
875 | pnfs_put_lseg(pgio->pg_lseg); | ||
876 | pgio->pg_lseg = NULL; | ||
866 | } | 877 | } |
867 | 878 | ||
868 | static void | 879 | static void |
@@ -905,8 +916,12 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio, | |||
905 | 916 | ||
906 | for (i = 0; i < pgio->pg_mirror_count; i++) { | 917 | for (i = 0; i < pgio->pg_mirror_count; i++) { |
907 | ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, i, true); | 918 | ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, i, true); |
908 | if (!ds) | 919 | if (!ds) { |
909 | goto out_mds; | 920 | if (ff_layout_no_fallback_to_mds(pgio->pg_lseg)) |
921 | goto out_pnfs; | ||
922 | else | ||
923 | goto out_mds; | ||
924 | } | ||
910 | pgm = &pgio->pg_mirrors[i]; | 925 | pgm = &pgio->pg_mirrors[i]; |
911 | mirror = FF_LAYOUT_COMP(pgio->pg_lseg, i); | 926 | mirror = FF_LAYOUT_COMP(pgio->pg_lseg, i); |
912 | pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].wsize; | 927 | pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].wsize; |
@@ -918,6 +933,12 @@ out_mds: | |||
918 | pnfs_put_lseg(pgio->pg_lseg); | 933 | pnfs_put_lseg(pgio->pg_lseg); |
919 | pgio->pg_lseg = NULL; | 934 | pgio->pg_lseg = NULL; |
920 | nfs_pageio_reset_write_mds(pgio); | 935 | nfs_pageio_reset_write_mds(pgio); |
936 | return; | ||
937 | |||
938 | out_pnfs: | ||
939 | pnfs_set_lo_fail(pgio->pg_lseg); | ||
940 | pnfs_put_lseg(pgio->pg_lseg); | ||
941 | pgio->pg_lseg = NULL; | ||
921 | } | 942 | } |
922 | 943 | ||
923 | static unsigned int | 944 | static unsigned int |