From patchwork Thu Sep 26 18:40:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950111 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73EAE9F288 for ; Thu, 26 Sep 2013 18:40:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC07A202E5 for ; Thu, 26 Sep 2013 18:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1B2B202DD for ; Thu, 26 Sep 2013 18:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387Ab3IZSkK (ORCPT ); Thu, 26 Sep 2013 14:40:10 -0400 Received: from mail-qc0-f182.google.com ([209.85.216.182]:41439 "EHLO mail-qc0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808Ab3IZSkK (ORCPT ); Thu, 26 Sep 2013 14:40:10 -0400 Received: by mail-qc0-f182.google.com with SMTP id n4so1057088qcx.27 for ; Thu, 26 Sep 2013 11:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SLe7NBw0P0zbb/smC4pglGlYpaM9X8N21c650WgxOkE=; b=Sc0gQr5xBVaakRVYI+5L7A85udUiMXs2wPlaoMQXIhk8SeF5gAcve9BeMZpwRBOzXo nZ5PqA9mU2xM8FQS1b3rlYA8w62gz2ecLchgCqaW/z+9T8NQjzimiaTnqORa8vg8xZza qJQFWl/mwLYaAJZZIdwMfCzNd82tjgFwBSwwlfbJPGNcoAN/C0q40ohBkfORIJNRgmqs V6hAFy/6RBUvMR1yfiqy1tLJNTDT4NPeg8zgVYuxSkwYF1gjqhtNr6HnoNCL1yiuOf1e I+6PEAcfQ3LkCcKX3+uGAIz0omvy8e20lkXdLQLpG5GSpqwTD+BKPyuiaOhDhAHAef4M kHwA== X-Received: by 10.229.192.6 with SMTP id do6mr3633260qcb.3.1380220809485; Thu, 26 Sep 2013 11:40:09 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id u4sm10265102qat.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:40:08 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 04/49] pnfsd: don't set up back channel on create_session for ds Date: Thu, 26 Sep 2013 14:40:07 -0400 Message-Id: <1380220807-12857-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dean Hildebrand [was pnfsd: Add use of pnfs exchange flags] Signed-off-by: Dean Hildebrand [pnfsd: define a is_ds_only_session helper] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 4 ++++ include/uapi/linux/nfs4.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 21c15fc..2c973e6 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1953,6 +1953,10 @@ static __be32 nfsd4_check_cb_sec(struct nfsd4_cb_sec *cbs) status = nfserr_seq_misordered; goto out_free_conn; } + + if (is_ds_only_session(unconf->cl_exchange_flags)) + cr_ses->flags &= ~SESSION4_BACK_CHAN; + old = find_confirmed_client_by_name(&unconf->cl_name, nn); if (old) { status = mark_client_expired(old); diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h index 788128e..028f5fc 100644 --- a/include/uapi/linux/nfs4.h +++ b/include/uapi/linux/nfs4.h @@ -125,6 +125,13 @@ #define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000 #define EXCHGID4_FLAG_MASK_PNFS 0x00070000 +static inline bool +is_ds_only_session(u32 exchange_flags) +{ + u32 mask = EXCHGID4_FLAG_USE_PNFS_DS | EXCHGID4_FLAG_USE_PNFS_MDS; + return (exchange_flags & mask) == EXCHGID4_FLAG_USE_PNFS_DS; +} + #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 /*