]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pNFS: Don't send COMMITs to the DSes if the server invalidated our layout
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 29 Apr 2017 14:27:18 +0000 (10:27 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 29 Apr 2017 15:29:24 +0000 (11:29 -0400)
If the layout was invalidated, then assume we should requeue all the
pending writes for the DS in question.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs_nfs.c

index dc4111d08a275358c516098889e6450be8d25bc8..7697ac0ff81ac3e4917f241dc89a1087dc1a88e9 100644 (file)
@@ -217,6 +217,13 @@ pnfs_generic_alloc_ds_commits(struct nfs_commit_info *cinfo,
        for (i = 0; i < fl_cinfo->nbuckets; i++, bucket++) {
                if (list_empty(&bucket->committing))
                        continue;
+               /*
+                * If the layout segment is invalid, then let
+                * pnfs_generic_retry_commit() clean up the bucket.
+                */
+               if (!pnfs_is_valid_lseg(bucket->clseg) &&
+                   !test_bit(NFS_LSEG_LAYOUTRETURN, &bucket->clseg->pls_flags))
+                       continue;
                data = nfs_commitdata_alloc(false);
                if (!data)
                        break;