]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFS: Ensure we reset the write verifier 'committed' value on resend.
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 2 Jun 2016 01:42:32 +0000 (21:42 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 5 Jul 2016 23:11:02 +0000 (19:11 -0400)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/direct.c
fs/nfs/internal.h

index d6d43b5eafb3274de9df67b7eec1847363fbf35a..fb659bb506780d7eb3a554c484d7d4ec43e2dd40 100644 (file)
@@ -661,6 +661,8 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
        nfs_direct_write_scan_commit_list(dreq->inode, &reqs, &cinfo);
 
        dreq->count = 0;
+       dreq->verf.committed = NFS_INVALID_STABLE_HOW;
+       nfs_clear_pnfs_ds_commit_verifiers(&dreq->ds_cinfo);
        for (i = 0; i < dreq->mirror_count; i++)
                dreq->mirrors[i].count = 0;
        get_dreq(dreq);
index 150a8eb0f323a8887a31c50273d0b37e8e675799..0eb5c924886dbea68f509c1ae0a2a5b7df72ce88 100644 (file)
@@ -499,6 +499,23 @@ int nfs_key_timeout_notify(struct file *filp, struct inode *inode);
 bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx);
 void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio);
 
+#ifdef CONFIG_NFS_V4_1
+static inline
+void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo)
+{
+       int i;
+
+       for (i = 0; i < cinfo->nbuckets; i++)
+               cinfo->buckets[i].direct_verf.committed = NFS_INVALID_STABLE_HOW;
+}
+#else
+static inline
+void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo)
+{
+}
+#endif
+
+
 #ifdef CONFIG_MIGRATION
 extern int nfs_migrate_page(struct address_space *,
                struct page *, struct page *, enum migrate_mode);