From patchwork Fri Sep 25 11:25:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 7263421 Return-Path: X-Original-To: patchwork-cifs-client@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 2576DBEEC1 for ; Fri, 25 Sep 2015 11:25:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6342320664 for ; Fri, 25 Sep 2015 11:25:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8059E2062A for ; Fri, 25 Sep 2015 11:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbbIYLZx (ORCPT ); Fri, 25 Sep 2015 07:25:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203AbbIYLZw (ORCPT ); Fri, 25 Sep 2015 07:25:52 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 546022589E; Fri, 25 Sep 2015 11:25:52 +0000 (UTC) Received: from nuc.home.com (vpn1-5-114.ams2.redhat.com [10.36.5.114]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8PBPlYN016313; Fri, 25 Sep 2015 07:25:48 -0400 From: Andreas Gruenbacher To: Andreas Gruenbacher Cc: "J. Bruce Fields" , LKML , linux-fsdevel , Linux NFS Mailing List , Linux API Mailing List , linux-cifs@vger.kernel.org, LSM List Subject: Re: [RFC v7 25/41] richacl: Isolate the owner and group classes Date: Fri, 25 Sep 2015 13:25:41 +0200 Message-Id: <1443180341-22911-1-git-send-email-agruenba@redhat.com> References: <1441448856-13478-1-git-send-email-agruenba@redhat.com> <1441448856-13478-26-git-send-email-agruenba@redhat.com> <20150922190224.GA19127@fieldses.org> In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Here is another minor improvement that produces deny aces with fewer permissions in them and avoids creating unnecessary deny aces in some cases. Andreas --- fs/richacl_compat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/richacl_compat.c b/fs/richacl_compat.c index 2f53394..bc0bcfe 100644 --- a/fs/richacl_compat.c +++ b/fs/richacl_compat.c @@ -605,14 +605,13 @@ __richacl_isolate_who(struct richacl_alloc *alloc, struct richace *who, int n; /* - * Compute the permissions already denied to @who. There are no + * Compute the permissions already defined for @who. There are no * everyone@ deny aces left in the acl at this stage. */ richacl_for_each_entry(ace, acl) { if (richace_is_inherit_only(ace)) continue; - if (richace_is_same_identifier(acl, ace, who) && - richace_is_deny(ace)) + if (richace_is_same_identifier(acl, ace, who)) deny &= ~ace->e_mask; } if (!deny)