From patchwork Sun Mar 15 15:13:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6013381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C5FA9F318 for ; Sun, 15 Mar 2015 15:13:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3717D2024F for ; Sun, 15 Mar 2015 15:13:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 527BE20220 for ; Sun, 15 Mar 2015 15:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbbCOPNk (ORCPT ); Sun, 15 Mar 2015 11:13:40 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:33779 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbbCOPNj (ORCPT ); Sun, 15 Mar 2015 11:13:39 -0400 Received: by pdnc3 with SMTP id c3so33188062pdn.0 for ; Sun, 15 Mar 2015 08:13:39 -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 :content-type:content-transfer-encoding; bh=Tf7Wygj5asRjcv1UcmhJxFSJ4XS2lM+etUVz2K7iVLo=; b=zXsosapd7/YNhsqL0T6HEjRHeVSExCjPo5aIx5R2VqrS7sLjfBjpxcNIlCP7OVuWj5 QkcF2gIekMpfIfwSzBCE6QYfuFBfR8yKrGawsRVBrkFprOGfK+z+pBdgnF8XF32VhM0s XSHS3EURptWl6TKkQXGqutIMjrw18+roX7igviz0+APrIEVaRDyx6PfyTGrzFlG7Zhch nsrNb+N5UeXTh6xx0X27JlJrKgR3SBxUU8WtAnw0IUsSOmQpgVzt3uFcAqS98+uFy1i8 VyupbwIraUtZaaXP58hV4jsxMOf4lrR6Ky9AyzkHezxepjqGSl5UcPWM898CcxWUXlTP mHEQ== X-Received: by 10.70.1.227 with SMTP id 3mr47097349pdp.110.1426432419417; Sun, 15 Mar 2015 08:13:39 -0700 (PDT) Received: from [192.168.99.2] ([104.143.41.8]) by mx.google.com with ESMTPSA id ji6sm12849403pac.30.2015.03.15.08.13.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2015 08:13:38 -0700 (PDT) Message-ID: <5505A19C.9020603@gmail.com> Date: Sun, 15 Mar 2015 23:13:32 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Linux NFS Mailing List Subject: [PATCH] NFSD: Using path_equal() for checking two paths 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 Signed-off-by: Kinglong Mee --- fs/nfsd/export.c | 3 +-- fs/nfsd/nfs4xdr.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index c3e3b6e..2911f51 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -691,8 +691,7 @@ static int svc_export_match(struct cache_head *a, struct cache_head *b) struct svc_export *orig = container_of(a, struct svc_export, h); struct svc_export *new = container_of(b, struct svc_export, h); return orig->ex_client == new->ex_client && - orig->ex_path.dentry == new->ex_path.dentry && - orig->ex_path.mnt == new->ex_path.mnt; + path_equal(&orig->ex_path, &new->ex_path); } static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index df5e66c..a6a9b90 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2008,7 +2008,7 @@ static __be32 nfsd4_encode_path(struct xdr_stream *xdr, * dentries/path components in an array. */ for (;;) { - if (cur.dentry == root->dentry && cur.mnt == root->mnt) + if (path_equal(&cur, root)) break; if (cur.dentry == cur.mnt->mnt_root) { if (follow_up(&cur))