From patchwork Mon Aug 31 02:53:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 7098311 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 B257CBEEC1 for ; Mon, 31 Aug 2015 02:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A768320787 for ; Mon, 31 Aug 2015 02:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEE3920773 for ; Mon, 31 Aug 2015 02:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752339AbbHaCxn (ORCPT ); Sun, 30 Aug 2015 22:53:43 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35124 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752311AbbHaCxm (ORCPT ); Sun, 30 Aug 2015 22:53:42 -0400 Received: by pacdd16 with SMTP id dd16so122918305pac.2 for ; Sun, 30 Aug 2015 19:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=pntyKY2PbyM4ZEMlN0eUV1q7KEt+4MAUJZI6bUgHHvE=; b=BkSuXtBywILvJpdFbaTKflGaL6Uj7qKVoBkZ6ifV3jJVHFFbD4iba2/fo4gKFGNl9j ghtwW1Xk9HXWOl38OC9z0fkvVQq6hX5koad04HhdDdUtZEVIGZiSgeBoziP32ZI4Ky5Z Q2EQ2m5Od4v5ecYW2NR9ZQhvdXR0cXxmgpRqx1Wh26s7L1fcE1WBiK7N8iJblbcBq+a9 yQkxR9gLnzu8fO2E7CNLlULO4rZhbvpwXCgUFDa2Ezo++JyeKaTh66/Xi6jTvTQ6g/JF jBEadXmijko3Sw+ZgDLV31uneQ5i3PE/Q9FxoGAUGUmelFK6E9lCWPdHl5tLT4XR/iWh cZXA== X-Received: by 10.68.197.231 with SMTP id ix7mr33981028pbc.85.1440989621945; Sun, 30 Aug 2015 19:53:41 -0700 (PDT) Received: from [192.168.99.13] ([104.143.41.79]) by smtp.googlemail.com with ESMTPSA id h4sm12616358pdr.41.2015.08.30.19.53.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 19:53:41 -0700 (PDT) To: Trond Myklebust Cc: "linux-nfs@vger.kernel.org" , kinglongmee@gmail.com From: Kinglong Mee Subject: [PATCH 1/2] nfs: Fix truncated client owner id without proto type Message-ID: <55E3C1AD.10800@gmail.com> Date: Mon, 31 Aug 2015 10:53:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 The length of "Linux NFSv4.0 " is 14, not 10. Without this patch, I get a truncated client owner id as, "Linux NFSv4.0 ::1/::1" With this patch, "Linux NFSv4.0 ::1/::1 tcp" Fixex: a319268891 ("nfs: make nfs4_init_nonuniform_client_string use a dynamically allocated buffer") Signed-off-by: Kinglong Mee --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 3acb1eb..b7d1bc0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -4984,7 +4984,7 @@ nfs4_init_nonuniform_client_string(struct nfs_client *clp) return 0; retry: rcu_read_lock(); - len = 10 + strlen(clp->cl_ipaddr) + 1 + + len = 14 + strlen(clp->cl_ipaddr) + 1 + strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) + 1 + strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +