From patchwork Thu Jun 16 15:39:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 887732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5GFdKtT019017 for ; Thu, 16 Jun 2011 15:39:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096Ab1FPPjT (ORCPT ); Thu, 16 Jun 2011 11:39:19 -0400 Received: from mail-vx0-f174.google.com ([209.85.220.174]:34952 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753258Ab1FPPjS (ORCPT ); Thu, 16 Jun 2011 11:39:18 -0400 Received: by vxi39 with SMTP id 39so1256271vxi.19 for ; Thu, 16 Jun 2011 08:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=trFZ/o6UXd988IjP1BV7XbhckG2dzVaYWKqKxVX27J0=; b=MC3/a1B1oLGFAvKbmVwODTP8PExwx7qbv9T78rhv16pGKsOrzgLS7oYqwd+amSzfiV SET9AT9CpWRsTVuS4mNB798qJvn8FHW4ftWnsdTSxRH7pPlHzrUD/bowHKG+kr+62tuj IUu8IhBpd5W9MgDUgzJxzC24uBjrgpV7/dtl4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=eoqp4Zl/uggit/JPlqqEWcLsYsdDRrPKVKidkxWxwUD50dMj8Slpee3+csn58gaDOW Nt9hfaJhYJf26iWJU5n4hAq7Ibvl4+GHYxN34WLNcrRSA7/+j6/fg688kF944B/FBzYz cZ+5JFt7Y8ygnXgq5K+1nMxTWRnj+gSmI4piI= Received: by 10.52.112.106 with SMTP id ip10mr1450928vdb.127.1308238757328; Thu, 16 Jun 2011 08:39:17 -0700 (PDT) Received: from localhost.localdomain (tonian-2.citi.umich.edu [141.212.112.251]) by mx.google.com with ESMTPS id j4sm579218vdu.19.2011.06.16.08.39.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2011 08:39:16 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH] NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND Date: Thu, 16 Jun 2011 11:39:10 -0400 Message-Id: <1308238750-9822-1-git-send-email-benny@tonian.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 16 Jun 2011 15:39:20 +0000 (UTC) From RFC5661, section 18.50: DESTROY_CLIENTID MAY be preceded with a SEQUENCE operation as long as the client ID derived from the session ID of SEQUENCE is not the same as the client ID to be destroyed. If the client IDs are the same, then the server MUST return NFS4ERR_CLIENTID_BUSY. (that's not implemented yet) If DESTROY_CLIENTID is not prefixed by SEQUENCE, it MUST be the only operation in the COMPOUND request (otherwise, the server MUST return NFS4ERR_NOT_ONLY_OP). Signed-off-by: Benny Halevy --- fs/nfsd/nfs4proc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 730b6e7..02adcc3 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1773,6 +1773,11 @@ static struct nfsd4_operation nfsd4_ops[] = { .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP, .op_name = "OP_SEQUENCE", }, + [OP_DESTROY_CLIENTID] = { + .op_func = NULL, + .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP, + .op_name = "OP_DESTROY_CLIENTID", + }, [OP_RECLAIM_COMPLETE] = { .op_func = (nfsd4op_func)nfsd4_reclaim_complete, .op_flags = ALLOWED_WITHOUT_FH,