From patchwork Fri Apr 18 04:03:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4013021 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 651F89F319 for ; Fri, 18 Apr 2014 04:04:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 571552035D for ; Fri, 18 Apr 2014 04:04:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61EB12035C for ; Fri, 18 Apr 2014 04:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750830AbaDREDu (ORCPT ); Fri, 18 Apr 2014 00:03:50 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:64288 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804AbaDREDt (ORCPT ); Fri, 18 Apr 2014 00:03:49 -0400 Received: by mail-pb0-f43.google.com with SMTP id um1so1076426pbc.2 for ; Thu, 17 Apr 2014 21:03:49 -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=KO84XN2cCkM8D7LDTqs2SgAFxiY3ccZoz2n1o++ad/s=; b=v4nAh52KSmSRD90z/SNAUjzo/sgenWUbHIPPkNSE2fCrAbrt48BVcfJ5gzQN0NuJct G7gkXeqOGgMNMdxKWOjgK5iwVwEvi7PALa5cPwSBo2IgA9hvfOPlB+SsSEHd4MBKVgjW cojfx9Rd2VVA7IQAVf5dGVBHtMw6KgTY5GogEUzfi0OTRNb0M+yuQWpHb/TtKSRfr3br HrHFmpNpqEj4oLZ0D5/9OMsfnJy+R3CGtRjnfFBtNNII3i/Eo4xN1/g7inJ137HUMH+W q7KYw3Phi0YZ4o41RbXxIsHPp9wf6DO/YvMVTVROXQGBuplmHaktajIkC3D+7BfpLdcN ZP3w== X-Received: by 10.68.235.6 with SMTP id ui6mr19505499pbc.45.1397793829416; Thu, 17 Apr 2014 21:03:49 -0700 (PDT) Received: from [192.168.0.102] ([171.208.185.170]) by mx.google.com with ESMTPSA id iq10sm56917050pbc.14.2014.04.17.21.03.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 21:03:48 -0700 (PDT) Message-ID: <5350A406.5060700@gmail.com> Date: Fri, 18 Apr 2014 12:03:18 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Christoph Hellwig CC: "J. Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH] NFSD: Clear cached acl after setting a zero-length default posix acl: References: <534FCD13.303@gmail.com> <20140417143634.GA20857@infradead.org> In-Reply-To: <20140417143634.GA20857@infradead.org> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 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 On 2014/4/17 22:36, Christoph Hellwig wrote: > On Thu, Apr 17, 2014 at 08:46:11PM +0800, Kinglong Mee wrote: >> After setting ACL for directory, I got two problems that caused >> by the cached zero-length default posix acl. >> >> This patch just clears the cached zero-length default posix acl >> after setting. >> >> First problem: >> # nfs4_setfacl -s A::OWNER@:RWX /mnt/123/; touch /mnt/123/test >> ............ hang ........... > > Nfsd must not call forget_cached_acl, that's the filesystems job. > I think the right fix is to make sure nfsd4_set_nfs4_acl calls ->set_acl > with a NULL ACL structure if there are no entries. Thanks for your advice. > > Btw, it would be really good if we kept tests like this as a regression > test suite. Is there one for NFS already? If not we could add > nfs-specific tests to xfstests as well. I found one at http://www.citi.umich.edu/projects/asci/icsi-alpha/acl-test-20060929.tar.gz , but it does not work on Fedora 20 without the following patch. thanks, Kinglong Mee From 6fb72997379ef84fdbcf4938dc68a6ef7c4f1f00 Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Thu, 17 Apr 2014 19:57:15 +0800 Subject: [PATCH] nfs4_set_acl has delete l/s/f flags, using r/w/a Signed-off-by: Kinglong Mee --- runtests | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runtests b/runtests index 25d4a9d..d0eeedd 100755 --- a/runtests +++ b/runtests @@ -79,30 +79,30 @@ $r $u $prog setacl "$a":rwaxdnNtTcoy $file $file # Create a test directory, give owner all permissions mkdir $dir -nfs4_setfacl -s "$a":xlfsDnNtTcCoy $dir +nfs4_setfacl -s "$a":xrwaDnNtTcCoy $dir # Remove permissions one at a time, check that they're really gone -$r $u $prog creat "$a":xlsDnNtTcCoy $dir $dir/$file -$r $u $prog listdir "$a":xsfDnNtTcCoy $dir $dir -$r $u $prog mkdir "$a":xlfDnNtTcCoy $dir $dir/$dir +$r $u $prog creat "$a":xraDnNtTcCoy $dir $dir/$file +$r $u $prog listdir "$a":xawDnNtTcCoy $dir $dir +$r $u $prog mkdir "$a":xrwDnNtTcCoy $dir $dir/$dir # Create a file for lookup and delete tests -nfs4_setfacl -s A::OWNER@:xlfsDnNtTcCoy $dir +nfs4_setfacl -s A::OWNER@:xrwaDnNtTcCoy $dir touch $dir/$file if (! -f $dir/$file) then echo "can't create $testdir/$dir/$file for testing" endif -$r $u $prog lookup "$a":lfsDnNtTcCoy $dir $dir/$file +$r $u $prog lookup "$a":rwaDnNtTcCoy $dir $dir/$file # Delete test: first have to put back lookup ("x") rights, # then remove "d", then "D" -nfs4_setfacl -s A::OWNER@:xlfsDnNtTcCoy $dir +nfs4_setfacl -s A::OWNER@:xrwaDnNtTcCoy $dir nfs4_setfacl -s "$a":rwaxnNtTcCoy $dir/$file if ($status != 0) then exit 1 endif -$r $u $prog rm "$a":xlfsnNtTcCoy $dir $dir/$file +$r $u $prog rm "$a":xrwanNtTcCoy $dir $dir/$file