diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-04-29 00:02:37 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-04-29 00:02:37 -0400 |
commit | 37f8aa16da8e9239092429e7a6dadf352897a92d (patch) | |
tree | 569e566fa369423f9067dc872ac1a5e90bbe2af7 /fs/nfs/pnfs.c | |
parent | bdebfccd0ea6fc00c5ea8c832401111958bd24cf (diff) |
pNFS/flexfiles: Fix up the ff_layout_write_pagelist failure path
If the attempt to write through pNFS fails, we need to use the same
failure semantics as for the read path: If the FF_FLAGS_NO_IO_THRU_MDS
flag is set or we have sufficient valid DSes, then we must retry through
pNFS
Fixes: d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e45b3ffeda08..6c2e4c73684c 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -2292,8 +2292,20 @@ pnfs_do_write(struct nfs_pageio_descriptor *desc, | |||
2292 | enum pnfs_try_status trypnfs; | 2292 | enum pnfs_try_status trypnfs; |
2293 | 2293 | ||
2294 | trypnfs = pnfs_try_to_write_data(hdr, call_ops, lseg, how); | 2294 | trypnfs = pnfs_try_to_write_data(hdr, call_ops, lseg, how); |
2295 | if (trypnfs == PNFS_NOT_ATTEMPTED) | 2295 | switch (trypnfs) { |
2296 | case PNFS_NOT_ATTEMPTED: | ||
2296 | pnfs_write_through_mds(desc, hdr); | 2297 | pnfs_write_through_mds(desc, hdr); |
2298 | case PNFS_ATTEMPTED: | ||
2299 | break; | ||
2300 | case PNFS_TRY_AGAIN: | ||
2301 | /* cleanup hdr and prepare to redo pnfs */ | ||
2302 | if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { | ||
2303 | struct nfs_pgio_mirror *mirror = nfs_pgio_current_mirror(desc); | ||
2304 | list_splice_init(&hdr->pages, &mirror->pg_list); | ||
2305 | mirror->pg_recoalesce = 1; | ||
2306 | } | ||
2307 | hdr->mds_ops->rpc_release(hdr); | ||
2308 | } | ||
2297 | } | 2309 | } |
2298 | 2310 | ||
2299 | static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) | 2311 | static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) |