]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfs/flexfilelayout/flexfilelayout.c
pNFS/flexfiles: Fix up the ff_layout_write_pagelist failure path
[karo-tx-linux.git] / fs / nfs / flexfilelayout / flexfilelayout.c
index f23b63eb356eab1f7d18ab1fad7f030f29a7e619..4e8bf02a62f91de13f4054e45966e5e8afd4521b 100644 (file)
@@ -1802,16 +1802,16 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
 
        ds = nfs4_ff_layout_prepare_ds(lseg, idx, true);
        if (!ds)
-               return PNFS_NOT_ATTEMPTED;
+               goto out_failed;
 
        ds_clnt = nfs4_ff_find_or_create_ds_client(lseg, idx, ds->ds_clp,
                                                   hdr->inode);
        if (IS_ERR(ds_clnt))
-               return PNFS_NOT_ATTEMPTED;
+               goto out_failed;
 
        ds_cred = ff_layout_get_ds_cred(lseg, idx, hdr->cred);
        if (!ds_cred)
-               return PNFS_NOT_ATTEMPTED;
+               goto out_failed;
 
        vers = nfs4_ff_layout_ds_version(lseg, idx);
 
@@ -1841,6 +1841,11 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
                          sync, RPC_TASK_SOFTCONN);
        put_rpccred(ds_cred);
        return PNFS_ATTEMPTED;
+
+out_failed:
+       if (ff_layout_avoid_mds_available_ds(lseg))
+               return PNFS_TRY_AGAIN;
+       return PNFS_NOT_ATTEMPTED;
 }
 
 static u32 calc_ds_index_from_commit(struct pnfs_layout_segment *lseg, u32 i)