]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
NFS/pnfs: Do not clobber existing pgio_done_cb in nfs4_proc_read_setup
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 28 Jun 2016 17:54:09 +0000 (13:54 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 30 Jun 2016 19:29:57 +0000 (15:29 -0400)
If a pNFS client sets hdr->pgio_done_cb, then we should not overwrite that
in nfs4_proc_read_setup()

Fixes: 75bf47ebf6b5 ("pNFS/flexfile: Fix erroneous fall back to...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c

index ff416d0e24bc25215a991c282e8ae19a65d31832..6191b7e469133229366f824566d0feb4c4a6155b 100644 (file)
@@ -4392,7 +4392,8 @@ static void nfs4_proc_read_setup(struct nfs_pgio_header *hdr,
                                 struct rpc_message *msg)
 {
        hdr->timestamp   = jiffies;
-       hdr->pgio_done_cb = nfs4_read_done_cb;
+       if (!hdr->pgio_done_cb)
+               hdr->pgio_done_cb = nfs4_read_done_cb;
        msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ];
        nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0);
 }