]> git.hungrycats.org Git - linux/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:24 +0000 (15:21 +0200)
commit ca857cc1d4cf17aba4bbb3b95d35454ad96924b3 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c

index e2320c6431073a1e3c9a5d3866b919f6e190f1d3..00fd0c716988923418c19787b29fa9c0fbddd348 100644 (file)
@@ -4393,7 +4393,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);
 }