From patchwork Wed Sep 16 18:49:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Filz X-Patchwork-Id: 7198571 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 F18BABEEC1 for ; Wed, 16 Sep 2015 18:50:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECFE920863 for ; Wed, 16 Sep 2015 18:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D54D920762 for ; Wed, 16 Sep 2015 18:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752924AbbIPSuT (ORCPT ); Wed, 16 Sep 2015 14:50:19 -0400 Received: from elasmtp-spurfowl.atl.sa.earthlink.net ([209.86.89.66]:48576 "EHLO elasmtp-spurfowl.atl.sa.earthlink.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752786AbbIPSuS (ORCPT ); Wed, 16 Sep 2015 14:50:18 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=mindspring.com; b=seaJhYvzyHykig7MZhroOGPz4N3bzo5mZ4VAuqNth9jbmaBDfmZ+wS/RaloAe8si; h=Received:Message-ID:Subject:From:To:Cc:Content-Type:Date:Mime-Version:X-Mailer:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP; Received: from [76.115.190.27] (helo=[192.168.0.117]) by elasmtp-spurfowl.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1ZcHmQ-00078n-IX; Wed, 16 Sep 2015 14:50:06 -0400 Message-ID: <1442429367.24127.6.camel@localhost.localdomain> Subject: [PATCH] Use a separate superblock if mount requires a different security flavor From: Frank Filz To: linux-nfs@vger.kernel.org Cc: trond.myklebust@primarydata.com, Chuck Lever Date: Wed, 16 Sep 2015 11:49:27 -0700 Mime-Version: 1.0 X-Mailer: Evolution 3.10.2 (3.10.2-2.fc20) X-ELNK-Trace: 136157f01908a8929c7f779228e2f6aeda0071232e20db4d108bf8b3adddae3ee3e7f978ce608a80350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 76.115.190.27 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, HK_RANDOM_FROM,RCVD_IN_DNSWL_HI,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 If a server has two exports from the same filesystem but with different security flavors allowed, when the client mounts first one and then the second, the same super block was being used. This resulted in the security flavor for the first export being applied to access to the second export. The fix is simply to check the security flavor of the nfs_server temporarily constructed for the second mount within nfs_compare_super. Signed-off-by: Frank S. Filz --- fs/nfs/super.c | 3 +++ 1 file changed, 3 insertions(+) return 0; /* Note: NFS_MOUNT_UNSHARED == NFS4_MOUNT_UNSHARED */ diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 084af10..44d60f1 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2455,6 +2455,9 @@ static int nfs_compare_super(struct super_block *sb, void *data) struct nfs_server *server = sb_mntdata->server, *old = NFS_SB(sb); int mntflags = sb_mntdata->mntflags; + if(old->client->cl_auth->au_flavor + != server->client->cl_auth->au_flavor) + return 0; if (!nfs_compare_super_address(old, server))