From patchwork Fri Jul 17 23:33:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6819951 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90598C05AC for ; Fri, 17 Jul 2015 23:33:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B138F207D4 for ; Fri, 17 Jul 2015 23:33:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A598A20602 for ; Fri, 17 Jul 2015 23:33:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756107AbbGQXdh (ORCPT ); Fri, 17 Jul 2015 19:33:37 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33884 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbbGQXdg (ORCPT ); Fri, 17 Jul 2015 19:33:36 -0400 Received: by pacan13 with SMTP id an13so68365827pac.1 for ; Fri, 17 Jul 2015 16:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1u1PR5SRP7idCXbAGKy7w02xU7m3HYEWbS1nw7gso+o=; b=uv5EMIa/6X+t+W5p7mewX4B5M16Ax1MyDJiyhk0IGuWChxWGWxWgVrkaMV3yHWXOwv WEAJSUBRAR9qKwSZirpxHuVi58KAli0A1NHD9ZFXC69VIicctYFEjUwP/QTiYmnpTTTa NbbBAC84GkRuZOVhW3yqcCTHAh2nkD3aiG/3cseeo5ablrhF2w/9x8BPxs2a0vZx2U60 f2LNavRpVFwz/hkhFp+9fo2E/NjPlzuf2OGDQqvmLyU7WLmSHVpje0GQkEEyQLQhUtwT uzDy2gO/VwUkMqvjXmjFgxxdKWoK/d2zkO0Q58+n6hYA3ZJyRnvnI8FAQeG5W+4FsslO dEMQ== X-Received: by 10.68.87.5 with SMTP id t5mr33435217pbz.137.1437176015606; Fri, 17 Jul 2015 16:33:35 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by smtp.googlemail.com with ESMTPSA id do3sm12444589pbb.5.2015.07.17.16.33.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2015 16:33:34 -0700 (PDT) Message-ID: <55A990CB.6020201@gmail.com> Date: Sat, 18 Jul 2015 07:33:31 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Jeff Layton , "linux-nfs@vger.kernel.org" , kinglongmee@gmail.com Subject: [PATCH] nfsd: New counter for generating client confirm verifier References: <55A384B1.8030207@gmail.com> <55A38505.6040405@gmail.com> <20150715204748.GA21669@fieldses.org> <20150715204950.GB21669@fieldses.org> <55A726A0.5090907@gmail.com> <55A72A1F.7060507@gmail.com> <20150717155846.GC6263@fieldses.org> <20150717134243.7bf809fa@tlielax.poochiereds.net> In-Reply-To: <20150717134243.7bf809fa@tlielax.poochiereds.net> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 If using clientid_counter, gen_confirm will generate same verifier in one second. A new counter for client confirm verifier make sure gen_confirm generating different each calling for the same clientid. Signed-off-by: Kinglong Mee Reviewed-by: Jeff Layton --- fs/nfsd/netns.h | 1 + fs/nfsd/nfs4state.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index ea6749a..d8b16c2 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -110,6 +110,7 @@ struct nfsd_net { unsigned int max_connections; u32 clientid_counter; + u32 clverifier_counter; struct svc_serv *nfsd_serv; }; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 61dfb33..5a64757e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1894,7 +1894,7 @@ static void gen_confirm(struct nfs4_client *clp, struct nfsd_net *nn) * __force to keep sparse happy */ verf[0] = (__force __be32)get_seconds(); - verf[1] = (__force __be32)nn->clientid_counter; + verf[1] = (__force __be32)nn->clverifier_counter++; memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data)); }