Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp347365rdb; Mon, 29 Jan 2024 04:21:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEn1jnk+YIrBXXaC2CAAruYpII8yXhxCp+FUzl1WKOTF/0+stzUfRb0ohuLq1BAN55p5Ow4 X-Received: by 2002:a05:6358:8a9:b0:176:8263:9a71 with SMTP id m41-20020a05635808a900b0017682639a71mr2720820rwj.13.1706530870979; Mon, 29 Jan 2024 04:21:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706530870; cv=pass; d=google.com; s=arc-20160816; b=r8gJbr6nsRM03B7w+u6TlIJYZX80eGjEw8x5T+M8pI9hLQnxUhW1XIwPesLTy1/Pkx VzcNjjmYN+3rlXcM6Wjp0uEOXa/oyWWPi+q7IHcCJ0f1p7YDLI/+W/xvw6UMvKpaMMp6 VnwxuLY6aZA3tpP20mQum3h9jEHcwYtSVNpb9ahaCqmDGPs5BivpVoKbt9J9qdbBX/do 47vp8Ujl/Ok5d3Np7UMmQ80nl6XHOZzW4jBBbFGtc6bR41zY+DKWA6zxJ8MpZopYFdGL YZyu4jEl/tjmIDzzJ9vNKp0Mm1T2x8/N3BANdCo0Nk0qkUIsFjcBcRnTjB1dw1b/bbYj LyPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=CNk0fSPyuQY/RZcwOZsDRzsDEEAvlQZXRk2iWgivslo=; fh=uI1U6Y87+GiyEtBGkRkfQN3UyvcDClIKN6IyjML0j8g=; b=h069VmQ08iv/xvKPBMiUAb9KYpLN963Y+e7l2YzaZQeA+sa2KFdWYfY+C3GTyyVrPa 0oMwnURnaxljXPBQpAvuaRj/YHQwTtmuXtHlQjfn7AwL+3pMKgIhFMLIsrTzgbFEDDKh s5bFkwD8YmvVBSbJWLLhoQCNoyptjaVzdtujUzOxgy3E/CtVoY92X+PhXP5JOSprtI++ Vbp3bilkGdjwZaz9GT/4bIJtMSRThkmRNt6NUg5NXvotm7kqOfnZSRaXX4ZWUyid/Yv/ DjQ3s86WINwsuYLIa0RFrK0UzB62CpNOgYgq6jlKIGUKCLhpzwBNTBUE2CTkgQZnccm6 ynqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t6LpZ4fy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y19-20020a637d13000000b005ce58684c5asi5543176pgc.449.2024.01.29.04.21.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 04:21:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t6LpZ4fy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 66C73284396 for ; Mon, 29 Jan 2024 12:21:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 491AB5EE89; Mon, 29 Jan 2024 12:21:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t6LpZ4fy" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 242B05B202 for ; Mon, 29 Jan 2024 12:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706530868; cv=none; b=Q4FrB8N3SkXIit/wQNriSwbnuUDsML8A2MmbV1x24K51lX7h9NyYpO0oL+caoM2Kci/9BRqGAoAXhaJdoeK0RU2scCVEFxWv+tuRCofOCVqqjyBnrke5SdWwb+tpwi9y2ALufbVVQ5AvZt37kfTOLQRyg3+cukzIl3b0xIQdHeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706530868; c=relaxed/simple; bh=BTzr8TmG5BQyNgmF1n5a4yTO/UAf2AuAIpoGVyeWIco=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=S/+T0UZsWjTyvS4UhiTqQo2iJm+i51yBzllAu+q4R4G0sgz4v3HllrG4t8CVBAbBXOkyW0QqSe6DhPRXMAOobVsuA193AW31uEvxNlvU2Mhr/fWd4Lol+4oNJIT0q+/QZJ4M1cUWqDbJ86QS35aI4AlsVkgqEdon+J1NZ/t1Ahg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t6LpZ4fy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEEE4C433F1; Mon, 29 Jan 2024 12:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706530866; bh=BTzr8TmG5BQyNgmF1n5a4yTO/UAf2AuAIpoGVyeWIco=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=t6LpZ4fyoC619xOK2sNGGTCd6FqhvsXHAG8QEmWep1Z82DTQEmpJ1lIRzO/GZTZyv S9ZydwV2+4NUcXmdfXfT6WAeEMPiBWZeYQOI79+uswiQ4pPO4tUaZfj7bTQhMmK11B 3xrlU/k4BXQNqsOMxQ1ji3Q2/IqRcZtL9ZoeW2B0S2gr/tiXsyHpOnVNkKntrREeVV wga0PH+ZKFd2Y3khiyZvDbrHU900HoLQrwIN1Pvop9COeG2kUAjM2BPhz3JyylDgds wxz4IiHR5D8z12vQAe3P45bdU1if3GfMkPJExsR0JPk80Ira1Du17R51+cGhELSKTf /fSBEu5WVwwFA== Message-ID: <5e2b0d038dcdd4054b92bf3171466f24639e0ba9.camel@kernel.org> Subject: Re: [PATCH 05/13] nfsd: split sc_status out of sc_type From: Jeff Layton To: NeilBrown , Chuck Lever Cc: linux-nfs@vger.kernel.org, Olga Kornievskaia , Dai Ngo , Tom Talpey , Christoph Hellwig , Tom Haynes Date: Mon, 29 Jan 2024 07:21:04 -0500 In-Reply-To: <20240129033637.2133-6-neilb@suse.de> References: <20240129033637.2133-1-neilb@suse.de> <20240129033637.2133-6-neilb@suse.de> Autocrypt: addr=jlayton@kernel.org; prefer-encrypt=mutual; keydata=mQINBE6V0TwBEADXhJg7s8wFDwBMEvn0qyhAnzFLTOCHooMZyx7XO7dAiIhDSi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ZpjmFWYKlSAHmURHrE8M0qRryQXvlhoQxlJR4nvQrjOPMsqWD5F9mcRyowOzr8amasLv43w92rD2nHoBK6rbFE/qC7AAjABEsZq8+TQmueN0maIXUQu7TBzejsEbV0i29z+kkrjU2NmK5pcxgAtehVxpZJ14LqmN6E0suTtzjNT1eMoqOPrMSx+6vOCIuvJ/MVYnQgHhjtPPnU86mebTY5Loy9YfJAC2EVpxtcCbx2KiwErTndEyWL+GL53LuScUD7tW8vYbGIp4RlnUgPLbqpgssq2gwYO9m75FGuKuB2+2bCGajqalid5nzeq9v7cYLLRgArJfOIBWZrHy2m0C+pFu9DSuV6SNr2dvMQUv1V58h0FaSOxHVQnJdnoHn13g/CKKvyg2EMrMt/EfcXgvDwQbnG9we4xJiWOIOcsvrWcB6C6lWBDA+In7w7SXnnok kZWuOsJdJQdmwlWC5L5ln9xgfr/4mOY38B0U= Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 (3.50.3-1.fc39) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-01-29 at 14:29 +1100, NeilBrown wrote: > sc_type identifies the type of a state - open, lock, deleg, layout - and > also the status of a state - closed or revoked. >=20 > This is a bit untidy and could get worse when "admin-revoked" states are > added. So clean it up. >=20 > With this patch, the type is now all that is stored in sc_type. This is > zero when the state is first added to ->cl_stateids (causing it to be > ignored), and is then set appropriately once it is fully initialised. > It is set under ->cl_lock to ensure atomicity w.r.t lookup. It is now > never cleared. >=20 > sc_type is still a bit-set even though at most one bit is set. This allo= ws > lookup functions to be given a bitmap of acceptable types. >=20 > sc_type is now an unsigned short rather than char. There is no value in > restricting to just 8 bits. >=20 > All the constants now start SC_TYPE_ matching the field in which they > are stored. Keeping the existing names and ensuring clear separation > from non-type flags would have required something like > NFS4_STID_TYPE_CLOSED which is cumbersome. The "NFS4" prefix is > redundant was they only appear in NFS4 code, so remove that and change > STID to SC to match the field. >=20 > The status is stored in a separate unsigned short named "sc_status". It > has two flags: SC_STATUS_CLOSED and SC_STATUS_REVOKED. > CLOSED combines NFS4_CLOSED_STID, NFS4_CLOSED_DELEG_STID, and is used > for SC_TYPE_LOCK and SC_TYPE_LAYOUT instead of setting the sc_type to zer= o. > These flags are only ever set, never cleared. > For deleg stateids they are set under the global state_lock. > For open and lock stateids they are set under ->cl_lock. > For layout stateids they are set under ->ls_lock >=20 > nfs4_unhash_stid() has been removed, and we never set sc_type =3D 0. Thi= s > was only used for LOCK and LAYOUT stids and they now use > SC_STATUS_CLOSED. >=20 > Also TRACE_DEFINE_NUM() calls for the various STID #define have been > removed because these things are not enums, and so that call is > incorrect. >=20 > Signed-off-by: NeilBrown > --- > fs/nfsd/nfs4layouts.c | 14 +-- > fs/nfsd/nfs4state.c | 207 +++++++++++++++++++++--------------------- > fs/nfsd/state.h | 40 +++++--- > fs/nfsd/trace.h | 31 +++---- > 4 files changed, 151 insertions(+), 141 deletions(-) >=20 > diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c > index 5e8096bc5eaa..857b822450b4 100644 > --- a/fs/nfsd/nfs4layouts.c > +++ b/fs/nfsd/nfs4layouts.c > @@ -236,7 +236,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_stat= e *cstate, > nfsd4_init_cb(&ls->ls_recall, clp, &nfsd4_cb_layout_ops, > NFSPROC4_CLNT_CB_LAYOUT); > =20 > - if (parent->sc_type =3D=3D NFS4_DELEG_STID) > + if (parent->sc_type =3D=3D SC_TYPE_DELEG) > ls->ls_file =3D nfsd_file_get(fp->fi_deleg_file); > else > ls->ls_file =3D find_any_file(fp); > @@ -250,7 +250,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_stat= e *cstate, > } > =20 > spin_lock(&clp->cl_lock); > - stp->sc_type =3D NFS4_LAYOUT_STID; > + stp->sc_type =3D SC_TYPE_LAYOUT; > list_add(&ls->ls_perclnt, &clp->cl_lo_states); > spin_unlock(&clp->cl_lock); > =20 > @@ -269,13 +269,13 @@ nfsd4_preprocess_layout_stateid(struct svc_rqst *rq= stp, > { > struct nfs4_layout_stateid *ls; > struct nfs4_stid *stid; > - unsigned char typemask =3D NFS4_LAYOUT_STID; > + unsigned short typemask =3D SC_TYPE_LAYOUT; > __be32 status; > =20 > if (create) > - typemask |=3D (NFS4_OPEN_STID | NFS4_LOCK_STID | NFS4_DELEG_STID); > + typemask |=3D (SC_TYPE_OPEN | SC_TYPE_LOCK | SC_TYPE_DELEG); > =20 > - status =3D nfsd4_lookup_stateid(cstate, stateid, typemask, &stid, > + status =3D nfsd4_lookup_stateid(cstate, stateid, typemask, 0, &stid, > net_generic(SVC_NET(rqstp), nfsd_net_id)); > if (status) > goto out; > @@ -286,7 +286,7 @@ nfsd4_preprocess_layout_stateid(struct svc_rqst *rqst= p, > goto out_put_stid; > } > =20 > - if (stid->sc_type !=3D NFS4_LAYOUT_STID) { > + if (stid->sc_type !=3D SC_TYPE_LAYOUT) { > ls =3D nfsd4_alloc_layout_stateid(cstate, stid, layout_type); > nfs4_put_stid(stid); > =20 > @@ -518,7 +518,7 @@ nfsd4_return_file_layouts(struct svc_rqst *rqstp, > lrp->lrs_present =3D true; > } else { > trace_nfsd_layoutstate_unhash(&ls->ls_stid.sc_stateid); > - nfs4_unhash_stid(&ls->ls_stid); > + ls->ls_stid.sc_status |=3D SC_STATUS_CLOSED; > lrp->lrs_present =3D false; > } > spin_unlock(&ls->ls_lock); > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index dbf9ed84610e..6bccdd0af814 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -1260,11 +1260,6 @@ static void destroy_unhashed_deleg(struct nfs4_del= egation *dp) > nfs4_put_stid(&dp->dl_stid); > } > =20 > -void nfs4_unhash_stid(struct nfs4_stid *s) > -{ > - s->sc_type =3D 0; > -} > - > /** > * nfs4_delegation_exists - Discover if this delegation already exists > * @clp: a pointer to the nfs4_client we're granting a delegation to > @@ -1317,7 +1312,7 @@ hash_delegation_locked(struct nfs4_delegation *dp, = struct nfs4_file *fp) > if (nfs4_delegation_exists(clp, fp)) > return -EAGAIN; > refcount_inc(&dp->dl_stid.sc_count); > - dp->dl_stid.sc_type =3D NFS4_DELEG_STID; > + dp->dl_stid.sc_type =3D SC_TYPE_DELEG; > list_add(&dp->dl_perfile, &fp->fi_delegations); > list_add(&dp->dl_perclnt, &clp->cl_delegations); > return 0; > @@ -1329,7 +1324,7 @@ static bool delegation_hashed(struct nfs4_delegatio= n *dp) > } > =20 > static bool > -unhash_delegation_locked(struct nfs4_delegation *dp, unsigned char type) > +unhash_delegation_locked(struct nfs4_delegation *dp, unsigned short stat= usmask) > { > struct nfs4_file *fp =3D dp->dl_stid.sc_file; > =20 > @@ -1339,8 +1334,9 @@ unhash_delegation_locked(struct nfs4_delegation *dp= , unsigned char type) > return false; > =20 > if (dp->dl_stid.sc_client->cl_minorversion =3D=3D 0) > - type =3D NFS4_CLOSED_DELEG_STID; > - dp->dl_stid.sc_type =3D type; > + statusmask =3D SC_STATUS_CLOSED; > + dp->dl_stid.sc_status |=3D statusmask; > + > /* Ensure that deleg break won't try to requeue it */ > ++dp->dl_time; > spin_lock(&fp->fi_lock); > @@ -1356,7 +1352,7 @@ static void destroy_delegation(struct nfs4_delegati= on *dp) > bool unhashed; > =20 > spin_lock(&state_lock); > - unhashed =3D unhash_delegation_locked(dp, NFS4_CLOSED_DELEG_STID); > + unhashed =3D unhash_delegation_locked(dp, SC_STATUS_CLOSED); > spin_unlock(&state_lock); > if (unhashed) > destroy_unhashed_deleg(dp); > @@ -1370,7 +1366,7 @@ static void revoke_delegation(struct nfs4_delegatio= n *dp) > =20 > trace_nfsd_stid_revoke(&dp->dl_stid); > =20 > - if (dp->dl_stid.sc_type =3D=3D NFS4_REVOKED_DELEG_STID) { > + if (dp->dl_stid.sc_status & SC_STATUS_REVOKED) { > spin_lock(&clp->cl_lock); > refcount_inc(&dp->dl_stid.sc_count); > list_add(&dp->dl_recall_lru, &clp->cl_revoked); > @@ -1379,8 +1375,8 @@ static void revoke_delegation(struct nfs4_delegatio= n *dp) > destroy_unhashed_deleg(dp); > } > =20 > -/*=20 > - * SETCLIENTID state=20 > +/* > + * SETCLIENTID state > */ > =20 > static unsigned int clientid_hashval(u32 id) > @@ -1543,7 +1539,7 @@ static bool unhash_lock_stateid(struct nfs4_ol_stat= eid *stp) > if (!unhash_ol_stateid(stp)) > return false; > list_del_init(&stp->st_locks); > - nfs4_unhash_stid(&stp->st_stid); > + stp->st_stid.sc_status |=3D SC_STATUS_CLOSED; > return true; > } > =20 > @@ -1622,6 +1618,7 @@ static void release_open_stateid(struct nfs4_ol_sta= teid *stp) > LIST_HEAD(reaplist); > =20 > spin_lock(&stp->st_stid.sc_client->cl_lock); > + stp->st_stid.sc_status |=3D SC_STATUS_CLOSED; > if (unhash_open_stateid(stp, &reaplist)) > put_ol_stateid_locked(stp, &reaplist); > spin_unlock(&stp->st_stid.sc_client->cl_lock); > @@ -2230,7 +2227,7 @@ __destroy_client(struct nfs4_client *clp) > spin_lock(&state_lock); > while (!list_empty(&clp->cl_delegations)) { > dp =3D list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl= _perclnt); > - unhash_delegation_locked(dp, NFS4_CLOSED_DELEG_STID); > + unhash_delegation_locked(dp, SC_STATUS_CLOSED); > list_add(&dp->dl_recall_lru, &reaplist); > } > spin_unlock(&state_lock); > @@ -2462,14 +2459,16 @@ find_stateid_locked(struct nfs4_client *cl, state= id_t *t) > } > =20 > static struct nfs4_stid * > -find_stateid_by_type(struct nfs4_client *cl, stateid_t *t, char typemask= ) > +find_stateid_by_type(struct nfs4_client *cl, stateid_t *t, > + unsigned short typemask, unsigned short ok_states) > { > struct nfs4_stid *s; > =20 > spin_lock(&cl->cl_lock); > s =3D find_stateid_locked(cl, t); > if (s !=3D NULL) { > - if (typemask & s->sc_type) > + if ((s->sc_status & ~ok_states) =3D=3D 0 && > + (typemask & s->sc_type)) > refcount_inc(&s->sc_count); > else > s =3D NULL; > @@ -2622,7 +2621,7 @@ static int nfs4_show_open(struct seq_file *s, struc= t nfs4_stid *st) > struct nfs4_stateowner *oo; > unsigned int access, deny; > =20 > - if (st->sc_type !=3D NFS4_OPEN_STID && st->sc_type !=3D NFS4_LOCK_STID) > + if (st->sc_type !=3D SC_TYPE_OPEN && st->sc_type !=3D SC_TYPE_LOCK) > return 0; /* XXX: or SEQ_SKIP? */ > ols =3D openlockstateid(st); > oo =3D ols->st_stateowner; > @@ -2754,13 +2753,13 @@ static int states_show(struct seq_file *s, void *= v) > struct nfs4_stid *st =3D v; > =20 > switch (st->sc_type) { > - case NFS4_OPEN_STID: > + case SC_TYPE_OPEN: > return nfs4_show_open(s, st); > - case NFS4_LOCK_STID: > + case SC_TYPE_LOCK: > return nfs4_show_lock(s, st); > - case NFS4_DELEG_STID: > + case SC_TYPE_DELEG: > return nfs4_show_deleg(s, st); > - case NFS4_LAYOUT_STID: > + case SC_TYPE_LAYOUT: > return nfs4_show_layout(s, st); > default: > return 0; /* XXX: or SEQ_SKIP? */ > @@ -4532,7 +4531,8 @@ nfsd4_find_existing_open(struct nfs4_file *fp, stru= ct nfsd4_open *open) > continue; > if (local->st_stateowner !=3D &oo->oo_owner) > continue; > - if (local->st_stid.sc_type =3D=3D NFS4_OPEN_STID) { > + if (local->st_stid.sc_type =3D=3D SC_TYPE_OPEN && > + !local->st_stid.sc_status) { > ret =3D local; > refcount_inc(&ret->st_stid.sc_count); > break; > @@ -4546,17 +4546,10 @@ nfsd4_verify_open_stid(struct nfs4_stid *s) > { > __be32 ret =3D nfs_ok; > =20 > - switch (s->sc_type) { > - default: > - break; > - case 0: > - case NFS4_CLOSED_STID: > - case NFS4_CLOSED_DELEG_STID: > - ret =3D nfserr_bad_stateid; > - break; > - case NFS4_REVOKED_DELEG_STID: > + if (s->sc_status & SC_STATUS_REVOKED) > ret =3D nfserr_deleg_revoked; > - } > + else if (s->sc_status & SC_STATUS_CLOSED) > + ret =3D nfserr_bad_stateid; > return ret; > } > =20 > @@ -4642,7 +4635,7 @@ init_open_stateid(struct nfs4_file *fp, struct nfsd= 4_open *open) > =20 > open->op_stp =3D NULL; > refcount_inc(&stp->st_stid.sc_count); > - stp->st_stid.sc_type =3D NFS4_OPEN_STID; > + stp->st_stid.sc_type =3D SC_TYPE_OPEN; > INIT_LIST_HEAD(&stp->st_locks); > stp->st_stateowner =3D nfs4_get_stateowner(&oo->oo_owner); > get_nfs4_file(fp); > @@ -4869,9 +4862,9 @@ static int nfsd4_cb_recall_done(struct nfsd4_callba= ck *cb, > =20 > trace_nfsd_cb_recall_done(&dp->dl_stid.sc_stateid, task); > =20 > - if (dp->dl_stid.sc_type =3D=3D NFS4_CLOSED_DELEG_STID || > - dp->dl_stid.sc_type =3D=3D NFS4_REVOKED_DELEG_STID) > - return 1; > + if (dp->dl_stid.sc_status) > + /* CLOSED or REVOKED */ > + return 1; > =20 > switch (task->tk_status) { > case 0: > @@ -5116,12 +5109,12 @@ static int share_access_to_flags(u32 share_access= ) > return share_access =3D=3D NFS4_SHARE_ACCESS_READ ? RD_STATE : WR_STATE= ; > } > =20 > -static struct nfs4_delegation *find_deleg_stateid(struct nfs4_client *cl= , stateid_t *s) > +static struct nfs4_delegation *find_deleg_stateid(struct nfs4_client *cl= , > + stateid_t *s) > { > struct nfs4_stid *ret; > =20 > - ret =3D find_stateid_by_type(cl, s, > - NFS4_DELEG_STID|NFS4_REVOKED_DELEG_STID); > + ret =3D find_stateid_by_type(cl, s, SC_TYPE_DELEG, SC_STATUS_REVOKED); > if (!ret) > return NULL; > return delegstateid(ret); > @@ -5144,7 +5137,7 @@ nfs4_check_deleg(struct nfs4_client *cl, struct nfs= d4_open *open, > deleg =3D find_deleg_stateid(cl, &open->op_delegate_stateid); > if (deleg =3D=3D NULL) > goto out; > - if (deleg->dl_stid.sc_type =3D=3D NFS4_REVOKED_DELEG_STID) { > + if (deleg->dl_stid.sc_status & SC_STATUS_REVOKED) { > nfs4_put_stid(&deleg->dl_stid); > status =3D nfserr_deleg_revoked; > goto out; > @@ -5777,7 +5770,6 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct = svc_fh *current_fh, struct nf > } else { > status =3D nfs4_get_vfs_file(rqstp, fp, current_fh, stp, open, true); > if (status) { > - stp->st_stid.sc_type =3D NFS4_CLOSED_STID; > release_open_stateid(stp); > mutex_unlock(&stp->st_mutex); > goto out; > @@ -6169,7 +6161,7 @@ nfs4_laundromat(struct nfsd_net *nn) > dp =3D list_entry (pos, struct nfs4_delegation, dl_recall_lru); > if (!state_expired(<, dp->dl_time)) > break; > - unhash_delegation_locked(dp, NFS4_REVOKED_DELEG_STID); > + unhash_delegation_locked(dp, SC_STATUS_REVOKED); > list_add(&dp->dl_recall_lru, &reaplist); > } > spin_unlock(&state_lock); > @@ -6408,22 +6400,20 @@ static __be32 nfsd4_validate_stateid(struct nfs4_= client *cl, stateid_t *stateid) > status =3D nfsd4_stid_check_stateid_generation(stateid, s, 1); > if (status) > goto out_unlock; > + status =3D nfsd4_verify_open_stid(s); > + if (status) > + goto out_unlock; > + > switch (s->sc_type) { > - case NFS4_DELEG_STID: > + case SC_TYPE_DELEG: > status =3D nfs_ok; > break; > - case NFS4_REVOKED_DELEG_STID: > - status =3D nfserr_deleg_revoked; > - break; > - case NFS4_OPEN_STID: > - case NFS4_LOCK_STID: > + case SC_TYPE_OPEN: > + case SC_TYPE_LOCK: > status =3D nfsd4_check_openowner_confirmed(openlockstateid(s)); > break; > default: > printk("unknown stateid type %x\n", s->sc_type); > - fallthrough; > - case NFS4_CLOSED_STID: > - case NFS4_CLOSED_DELEG_STID: > status =3D nfserr_bad_stateid; > } > out_unlock: > @@ -6433,7 +6423,8 @@ static __be32 nfsd4_validate_stateid(struct nfs4_cl= ient *cl, stateid_t *stateid) > =20 > __be32 > nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate, > - stateid_t *stateid, unsigned char typemask, > + stateid_t *stateid, > + unsigned short typemask, unsigned short statusmask, > struct nfs4_stid **s, struct nfsd_net *nn) > { > __be32 status; > @@ -6444,10 +6435,13 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state = *cstate, > * only return revoked delegations if explicitly asked. > * otherwise we report revoked or bad_stateid status. > */ > - if (typemask & NFS4_REVOKED_DELEG_STID) > + if (statusmask & SC_STATUS_REVOKED) > return_revoked =3D true; > - else if (typemask & NFS4_DELEG_STID) > - typemask |=3D NFS4_REVOKED_DELEG_STID; > + if (typemask & SC_TYPE_DELEG) > + /* Always allow REVOKED for DELEG so we can > + * retturn the appropriate error. > + */ > + statusmask |=3D SC_STATUS_REVOKED; > =20 > if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) || > CLOSE_STATEID(stateid)) > @@ -6460,14 +6454,12 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state = *cstate, > } > if (status) > return status; > - stid =3D find_stateid_by_type(cstate->clp, stateid, typemask); > + stid =3D find_stateid_by_type(cstate->clp, stateid, typemask, statusmas= k); > if (!stid) > return nfserr_bad_stateid; > - if ((stid->sc_type =3D=3D NFS4_REVOKED_DELEG_STID) && !return_revoked) = { > + if ((stid->sc_status & SC_STATUS_REVOKED) && !return_revoked) { > nfs4_put_stid(stid); > - if (cstate->minorversion) > - return nfserr_deleg_revoked; > - return nfserr_bad_stateid; > + return nfserr_deleg_revoked; > } > *s =3D stid; > return nfs_ok; > @@ -6478,17 +6470,17 @@ nfs4_find_file(struct nfs4_stid *s, int flags) > { > struct nfsd_file *ret =3D NULL; > =20 > - if (!s) > + if (!s || s->sc_status) > return NULL; > =20 > switch (s->sc_type) { > - case NFS4_DELEG_STID: > + case SC_TYPE_DELEG: > spin_lock(&s->sc_file->fi_lock); > ret =3D nfsd_file_get(s->sc_file->fi_deleg_file); > spin_unlock(&s->sc_file->fi_lock); > break; > - case NFS4_OPEN_STID: > - case NFS4_LOCK_STID: > + case SC_TYPE_OPEN: > + case SC_TYPE_LOCK: > if (flags & RD_STATE) > ret =3D find_readable_file(s->sc_file); > else > @@ -6601,7 +6593,8 @@ static __be32 find_cpntf_state(struct nfsd_net *nn,= stateid_t *st, > goto out; > =20 > *stid =3D find_stateid_by_type(found, &cps->cp_p_stateid, > - NFS4_DELEG_STID|NFS4_OPEN_STID|NFS4_LOCK_STID); > + SC_TYPE_DELEG|SC_TYPE_OPEN|SC_TYPE_LOCK, > + 0); > if (*stid) > status =3D nfs_ok; > else > @@ -6658,8 +6651,8 @@ nfs4_preprocess_stateid_op(struct svc_rqst *rqstp, > } > =20 > status =3D nfsd4_lookup_stateid(cstate, stateid, > - NFS4_DELEG_STID|NFS4_OPEN_STID|NFS4_LOCK_STID, > - &s, nn); > + SC_TYPE_DELEG|SC_TYPE_OPEN|SC_TYPE_LOCK, > + 0, &s, nn); > if (status =3D=3D nfserr_bad_stateid) > status =3D find_cpntf_state(nn, stateid, &s); > if (status) > @@ -6670,16 +6663,13 @@ nfs4_preprocess_stateid_op(struct svc_rqst *rqstp= , > goto out; > =20 > switch (s->sc_type) { > - case NFS4_DELEG_STID: > + case SC_TYPE_DELEG: > status =3D nfs4_check_delegmode(delegstateid(s), flags); > break; > - case NFS4_OPEN_STID: > - case NFS4_LOCK_STID: > + case SC_TYPE_OPEN: > + case SC_TYPE_LOCK: > status =3D nfs4_check_olstateid(openlockstateid(s), flags); > break; > - default: > - status =3D nfserr_bad_stateid; > - break; > } > if (status) > goto out; > @@ -6758,33 +6748,34 @@ nfsd4_free_stateid(struct svc_rqst *rqstp, struct= nfsd4_compound_state *cstate, > =20 > spin_lock(&cl->cl_lock); > s =3D find_stateid_locked(cl, stateid); > - if (!s) > + if (!s || s->sc_status & SC_STATUS_CLOSED) > goto out_unlock; > spin_lock(&s->sc_lock); > switch (s->sc_type) { > - case NFS4_DELEG_STID: > + case SC_TYPE_DELEG: > + if (s->sc_status & SC_STATUS_REVOKED) { > + spin_unlock(&s->sc_lock); > + dp =3D delegstateid(s); > + list_del_init(&dp->dl_recall_lru); > + spin_unlock(&cl->cl_lock); > + nfs4_put_stid(s); > + ret =3D nfs_ok; > + goto out; > + } > ret =3D nfserr_locks_held; > break; > - case NFS4_OPEN_STID: > + case SC_TYPE_OPEN: > ret =3D check_stateid_generation(stateid, &s->sc_stateid, 1); > if (ret) > break; > ret =3D nfserr_locks_held; > break; > - case NFS4_LOCK_STID: > + case SC_TYPE_LOCK: > spin_unlock(&s->sc_lock); > refcount_inc(&s->sc_count); > spin_unlock(&cl->cl_lock); > ret =3D nfsd4_free_lock_stateid(stateid, s); > goto out; > - case NFS4_REVOKED_DELEG_STID: > - spin_unlock(&s->sc_lock); > - dp =3D delegstateid(s); > - list_del_init(&dp->dl_recall_lru); > - spin_unlock(&cl->cl_lock); > - nfs4_put_stid(s); > - ret =3D nfs_ok; > - goto out; > /* Default falls through and returns nfserr_bad_stateid */ > } > spin_unlock(&s->sc_lock); > @@ -6827,6 +6818,7 @@ static __be32 nfs4_seqid_op_checks(struct nfsd4_com= pound_state *cstate, stateid_ > * @seqid: seqid (provided by client) > * @stateid: stateid (provided by client) > * @typemask: mask of allowable types for this operation > + * @statusmask: mask of allowed states: 0 or STID_CLOSED > * @stpp: return pointer for the stateid found > * @nn: net namespace for request > * > @@ -6836,7 +6828,8 @@ static __be32 nfs4_seqid_op_checks(struct nfsd4_com= pound_state *cstate, stateid_ > */ > static __be32 > nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, > - stateid_t *stateid, char typemask, > + stateid_t *stateid, > + unsigned short typemask, unsigned short statusmask, > struct nfs4_ol_stateid **stpp, > struct nfsd_net *nn) > { > @@ -6847,7 +6840,8 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_stat= e *cstate, u32 seqid, > trace_nfsd_preprocess(seqid, stateid); > =20 > *stpp =3D NULL; > - status =3D nfsd4_lookup_stateid(cstate, stateid, typemask, &s, nn); > + status =3D nfsd4_lookup_stateid(cstate, stateid, > + typemask, statusmask, &s, nn); > if (status) > return status; > stp =3D openlockstateid(s); > @@ -6869,7 +6863,7 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(st= ruct nfsd4_compound_state *cs > struct nfs4_ol_stateid *stp; > =20 > status =3D nfs4_preprocess_seqid_op(cstate, seqid, stateid, > - NFS4_OPEN_STID, &stp, nn); > + SC_TYPE_OPEN, 0, &stp, nn); > if (status) > return status; > oo =3D openowner(stp->st_stateowner); > @@ -6900,8 +6894,8 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct n= fsd4_compound_state *cstate, > return status; > =20 > status =3D nfs4_preprocess_seqid_op(cstate, > - oc->oc_seqid, &oc->oc_req_stateid, > - NFS4_OPEN_STID, &stp, nn); > + oc->oc_seqid, &oc->oc_req_stateid, > + SC_TYPE_OPEN, 0, &stp, nn); > if (status) > goto out; > oo =3D openowner(stp->st_stateowner); > @@ -7031,18 +7025,20 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_= compound_state *cstate, > struct net *net =3D SVC_NET(rqstp); > struct nfsd_net *nn =3D net_generic(net, nfsd_net_id); > =20 > - dprintk("NFSD: nfsd4_close on file %pd\n",=20 > + dprintk("NFSD: nfsd4_close on file %pd\n", > cstate->current_fh.fh_dentry); > =20 > status =3D nfs4_preprocess_seqid_op(cstate, close->cl_seqid, > - &close->cl_stateid, > - NFS4_OPEN_STID|NFS4_CLOSED_STID, > - &stp, nn); > + &close->cl_stateid, > + SC_TYPE_OPEN, SC_STATUS_CLOSED, > + &stp, nn); > nfsd4_bump_seqid(cstate, status); > if (status) > - goto out;=20 > + goto out; > =20 > - stp->st_stid.sc_type =3D NFS4_CLOSED_STID; > + spin_lock(&stp->st_stid.sc_client->cl_lock); > + stp->st_stid.sc_status |=3D SC_STATUS_CLOSED; > + spin_unlock(&stp->st_stid.sc_client->cl_lock); > =20 > /* > * Technically we don't _really_ have to increment or copy it, since > @@ -7084,7 +7080,7 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nf= sd4_compound_state *cstate, > if ((status =3D fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0))) > return status; > =20 > - status =3D nfsd4_lookup_stateid(cstate, stateid, NFS4_DELEG_STID, &s, n= n); > + status =3D nfsd4_lookup_stateid(cstate, stateid, SC_TYPE_DELEG, 0, &s, = nn); > if (status) > goto out; > dp =3D delegstateid(s); > @@ -7351,7 +7347,7 @@ init_lock_stateid(struct nfs4_ol_stateid *stp, stru= ct nfs4_lockowner *lo, > if (retstp) > goto out_found; > refcount_inc(&stp->st_stid.sc_count); > - stp->st_stid.sc_type =3D NFS4_LOCK_STID; > + stp->st_stid.sc_type =3D SC_TYPE_LOCK; > stp->st_stateowner =3D nfs4_get_stateowner(&lo->lo_owner); > get_nfs4_file(fp); > stp->st_stid.sc_file =3D fp; > @@ -7538,9 +7534,10 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_co= mpound_state *cstate, > &lock_stp, &new); > } else { > status =3D nfs4_preprocess_seqid_op(cstate, > - lock->lk_old_lock_seqid, > - &lock->lk_old_lock_stateid, > - NFS4_LOCK_STID, &lock_stp, nn); > + lock->lk_old_lock_seqid, > + &lock->lk_old_lock_stateid, > + SC_TYPE_LOCK, 0, &lock_stp, > + nn); > } > if (status) > goto out; > @@ -7853,8 +7850,8 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_co= mpound_state *cstate, > return nfserr_inval; > =20 > status =3D nfs4_preprocess_seqid_op(cstate, locku->lu_seqid, > - &locku->lu_stateid, NFS4_LOCK_STID, > - &stp, nn); > + &locku->lu_stateid, SC_TYPE_LOCK, 0, > + &stp, nn); > if (status) > goto out; > nf =3D find_any_file(stp->st_stid.sc_file); > @@ -8292,7 +8289,7 @@ nfs4_state_shutdown_net(struct net *net) > spin_lock(&state_lock); > list_for_each_safe(pos, next, &nn->del_recall_lru) { > dp =3D list_entry (pos, struct nfs4_delegation, dl_recall_lru); > - unhash_delegation_locked(dp, NFS4_CLOSED_DELEG_STID); > + unhash_delegation_locked(dp, SC_STATUS_CLOSED); > list_add(&dp->dl_recall_lru, &reaplist); > } > spin_unlock(&state_lock); > diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h > index 41bdc913fa71..ffc8920d0558 100644 > --- a/fs/nfsd/state.h > +++ b/fs/nfsd/state.h > @@ -88,17 +88,33 @@ struct nfsd4_callback_ops { > */ > struct nfs4_stid { > refcount_t sc_count; > -#define NFS4_OPEN_STID 1 > -#define NFS4_LOCK_STID 2 > -#define NFS4_DELEG_STID 4 > -/* For an open stateid kept around *only* to process close replays: */ > -#define NFS4_CLOSED_STID 8 > + > + /* A new stateid is added to the cl_stateids idr early before it > + * is fully initialised. Its sc_type is then zero. After > + * initialisation the sc_type it set under cl_lock, and then > + * never changes. > + */ > +#define SC_TYPE_OPEN BIT(0) > +#define SC_TYPE_LOCK BIT(1) > +#define SC_TYPE_DELEG BIT(2) > +#define SC_TYPE_LAYOUT BIT(3) > + unsigned short sc_type; > + > +/* state_lock protects sc_status for delegation stateids. > + * ->cl_lock protects sc_status for open and lock stateids. > + * ->st_mutex also protect sc_status for open stateids. > + * ->ls_lock protects sc_status for layout stateids. > + */ > +/* > + * For an open stateid kept around *only* to process close replays. > + * For deleg stateid, kept in idr until last reference is dropped. > + */ > +#define SC_STATUS_CLOSED BIT(0) > /* For a deleg stateid kept around only to process free_stateid's: */ > -#define NFS4_REVOKED_DELEG_STID 16 > -#define NFS4_CLOSED_DELEG_STID 32 > -#define NFS4_LAYOUT_STID 64 > +#define SC_STATUS_REVOKED BIT(1) > + unsigned short sc_status; > + > struct list_head sc_cp_list; > - unsigned char sc_type; > stateid_t sc_stateid; > spinlock_t sc_lock; > struct nfs4_client *sc_client; > @@ -672,15 +688,15 @@ extern __be32 nfs4_preprocess_stateid_op(struct svc= _rqst *rqstp, > stateid_t *stateid, int flags, struct nfsd_file **filp, > struct nfs4_stid **cstid); > __be32 nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate, > - stateid_t *stateid, unsigned char typemask, > - struct nfs4_stid **s, struct nfsd_net *nn); > + stateid_t *stateid, unsigned short typemask, > + unsigned short statusmask, > + struct nfs4_stid **s, struct nfsd_net *nn); > struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl, struct kmem_ca= che *slab, > void (*sc_free)(struct nfs4_stid *)); > int nfs4_init_copy_state(struct nfsd_net *nn, struct nfsd4_copy *copy); > void nfs4_free_copy_state(struct nfsd4_copy *copy); > struct nfs4_cpntf_state *nfs4_alloc_init_cpntf_state(struct nfsd_net *nn= , > struct nfs4_stid *p_stid); > -void nfs4_unhash_stid(struct nfs4_stid *s); > void nfs4_put_stid(struct nfs4_stid *s); > void nfs4_inc_and_copy_stateid(stateid_t *dst, struct nfs4_stid *stid); > void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *, struct nfs= d_net *); > diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h > index d1e8cf079b0f..fe08ca18b647 100644 > --- a/fs/nfsd/trace.h > +++ b/fs/nfsd/trace.h > @@ -641,23 +641,17 @@ DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \ > DEFINE_STATESEQID_EVENT(preprocess); > DEFINE_STATESEQID_EVENT(open_confirm); > =20 > -TRACE_DEFINE_ENUM(NFS4_OPEN_STID); > -TRACE_DEFINE_ENUM(NFS4_LOCK_STID); > -TRACE_DEFINE_ENUM(NFS4_DELEG_STID); > -TRACE_DEFINE_ENUM(NFS4_CLOSED_STID); > -TRACE_DEFINE_ENUM(NFS4_REVOKED_DELEG_STID); > -TRACE_DEFINE_ENUM(NFS4_CLOSED_DELEG_STID); > -TRACE_DEFINE_ENUM(NFS4_LAYOUT_STID); > - > #define show_stid_type(x) \ > __print_flags(x, "|", \ > - { NFS4_OPEN_STID, "OPEN" }, \ > - { NFS4_LOCK_STID, "LOCK" }, \ > - { NFS4_DELEG_STID, "DELEG" }, \ > - { NFS4_CLOSED_STID, "CLOSED" }, \ > - { NFS4_REVOKED_DELEG_STID, "REVOKED" }, \ > - { NFS4_CLOSED_DELEG_STID, "CLOSED_DELEG" }, \ > - { NFS4_LAYOUT_STID, "LAYOUT" }) > + { SC_TYPE_OPEN, "OPEN" }, \ > + { SC_TYPE_LOCK, "LOCK" }, \ > + { SC_TYPE_DELEG, "DELEG" }, \ > + { SC_TYPE_LAYOUT, "LAYOUT" }) > + > +#define show_stid_status(x) \ > + __print_flags(x, "|", \ > + { SC_STATUS_CLOSED, "CLOSED" }, \ > + { SC_STATUS_REVOKED, "REVOKED" }) \ > =20 > DECLARE_EVENT_CLASS(nfsd_stid_class, > TP_PROTO( > @@ -666,6 +660,7 @@ DECLARE_EVENT_CLASS(nfsd_stid_class, > TP_ARGS(stid), > TP_STRUCT__entry( > __field(unsigned long, sc_type) > + __field(unsigned long, sc_status) > __field(int, sc_count) > __field(u32, cl_boot) > __field(u32, cl_id) > @@ -676,16 +671,18 @@ DECLARE_EVENT_CLASS(nfsd_stid_class, > const stateid_t *stp =3D &stid->sc_stateid; > =20 > __entry->sc_type =3D stid->sc_type; > + __entry->sc_status =3D stid->sc_status; > __entry->sc_count =3D refcount_read(&stid->sc_count); > __entry->cl_boot =3D stp->si_opaque.so_clid.cl_boot; > __entry->cl_id =3D stp->si_opaque.so_clid.cl_id; > __entry->si_id =3D stp->si_opaque.so_id; > __entry->si_generation =3D stp->si_generation; > ), > - TP_printk("client %08x:%08x stateid %08x:%08x ref=3D%d type=3D%s", > + TP_printk("client %08x:%08x stateid %08x:%08x ref=3D%d type=3D%s state= =3D%s", > __entry->cl_boot, __entry->cl_id, > __entry->si_id, __entry->si_generation, > - __entry->sc_count, show_stid_type(__entry->sc_type) > + __entry->sc_count, show_stid_type(__entry->sc_type), > + show_stid_status(__entry->sc_status) > ) > ); > =20 Reviewed-by: Jeff Layton