From patchwork Sun Apr 5 15:13:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6162381 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 E85FF9F1BE for ; Sun, 5 Apr 2015 15:13:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D6262041A for ; Sun, 5 Apr 2015 15:13:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A0DB20411 for ; Sun, 5 Apr 2015 15:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751989AbbDEPNf (ORCPT ); Sun, 5 Apr 2015 11:13:35 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:33987 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752050AbbDEPNf (ORCPT ); Sun, 5 Apr 2015 11:13:35 -0400 Received: by pdbni2 with SMTP id ni2so19063371pdb.1 for ; Sun, 05 Apr 2015 08:13:34 -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=QL4Fsl+eTeMWIIe1fgFATqKtKmPaO5eBpjpJMOfHPyo=; b=LBT4KMGHenYDhbRkl3U2p9qaEqKflATXH7658mEV7vfgE1WRsl91M9ua32AuSgKwk/ AT8v3Zuo5ja414amGjvrzcuEY8d6JO3/8aLqkg+yef0rH8aImhBZa5/EuUcjUB6UVsei jZQz+20rImiTtnv/gNdyAcemJGVrlrcHx/no1AV2FFynbgv6meqH8L7loDjsUtwA1Sbd jdJKPetrhfiF40V6Zup3NF0JGUmmpDV2vA2Exe4GiSBrRIBKQ2QpS6ahdruHHsh6Lo2Y osqKqPE2WVSRpmBSlSZpM2jAyh1m9OBYcrCxBQ+xYtyYJK1x7BCBgPsYLIYvDxP0y3rW ENLg== X-Received: by 10.70.92.132 with SMTP id cm4mr20243310pdb.18.1428246814806; Sun, 05 Apr 2015 08:13:34 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id jx5sm1787922pbc.85.2015.04.05.08.13.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Apr 2015 08:13:33 -0700 (PDT) Message-ID: <55215117.2050504@gmail.com> Date: Sun, 05 Apr 2015 23:13:27 +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@vger.kernel.org" , Christoph Hellwig , kinglongmee@gmail.com Subject: [PATCH] nfsd: clear NFSEXP_PNFS flags if not supports pnfs in kernel 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 nfsd should not show "pnfs" flag in proc file if the filesystem does not support pnfs. # cat /proc/fs/nfsd/exports # Version 1.1 # Path Client(Flags) # IPs /testfs *(rw,insecure,no_root_squash,sync,wdelay,no_subtree_check,pnfs,fsid=0,uuid=37b07525:dc5e4203:99cc71b0:3df9dfa5,sec=1) Signed-off-by: Kinglong Mee --- fs/nfsd/nfs4layouts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 6904213..f4c9bf3 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c @@ -125,6 +125,8 @@ void nfsd4_setup_layout_type(struct svc_export *exp) sb->s_export_op->map_blocks && sb->s_export_op->commit_blocks) exp->ex_layout_type = LAYOUT_BLOCK_VOLUME; + else + exp->ex_flags &= ~NFSEXP_PNFS; } static void