Return-Path: Received: from mail-vk0-f65.google.com ([209.85.213.65]:52533 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbdJTSzC (ORCPT ); Fri, 20 Oct 2017 14:55:02 -0400 Received: by mail-vk0-f65.google.com with SMTP id i133so757497vke.9 for ; Fri, 20 Oct 2017 11:55:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20171020174747.GC31637@parsley.fieldses.org> References: <1508361919-30495-1-git-send-email-bfields@redhat.com> <20171019181718.GF16942@parsley.fieldses.org> <20171019202015.GG16942@parsley.fieldses.org> <20171020174747.GC31637@parsley.fieldses.org> From: Olga Kornievskaia Date: Fri, 20 Oct 2017 14:55:00 -0400 Message-ID: Subject: Re: [PATCH 1/2] nfsd4: fix cached replies to solo SEQUENCE compounds To: "J. Bruce Fields" Cc: Trond Myklebust , linux-nfs Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org List-ID: On Fri, Oct 20, 2017 at 1:47 PM, J. Bruce Fields wrote: > On Thu, Oct 19, 2017 at 05:19:40PM -0400, Olga Kornievskaia wrote: >> On Thu, Oct 19, 2017 at 5:04 PM, Olga Kornievskaia wrote: >> > I got this crash upon receiving the SEQUENCE that reused the slot that >> > was used by the ctrl-c-ed COPY. > > Yeah, I was being inconsistent about what "NFSD4_SLOT_CACHED" meant--in > replay_matches_cache I'm assuming opcnt and cred are still stored, but I > wasn't storing them in nfsd4_store_cache_entry. Not sure why that > didn't triger in my tests. > > Does this help? Yes. No oops and reply is SEQ_FALSE_RETRY. > --b. > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index ace89bf45a0b..4b2107d11d5e 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -2296,14 +2296,15 @@ nfsd4_store_cache_entry(struct nfsd4_compoundres *resp) > > slot->sl_flags |= NFSD4_SLOT_INITIALIZED; > free_svc_cred(&slot->sl_cred); > + copy_cred(&slot->sl_cred, &resp->rqstp->rq_cred); > + slot->sl_opcnt = resp->opcnt; > + slot->sl_status = resp->cstate.status; > + > if (!nfsd4_cache_this(resp)) { > slot->sl_flags &= ~NFSD4_SLOT_CACHED; > return; > } > slot->sl_flags |= NFSD4_SLOT_CACHED; > - copy_cred(&slot->sl_cred, &resp->rqstp->rq_cred); > - slot->sl_opcnt = resp->opcnt; > - slot->sl_status = resp->cstate.status; > > base = resp->cstate.data_offset; > slot->sl_datalen = buf->len - base;