From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A1EEC55183 for ; Tue, 21 Apr 2020 13:51:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F4B6206B8 for ; Tue, 21 Apr 2020 13:51:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZL7v/lqf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F4B6206B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0D8689FC9; Tue, 21 Apr 2020 13:51:49 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3811D6E982 for ; Tue, 21 Apr 2020 13:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587477105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=99/DqDTe+hR/W8XuUdq0eHElZlf6CH/+a6BKUqv6kfA=; b=ZL7v/lqf2a4SwztxkwU0liU5Z21E9DTbZ2mxBaQBz6EO5ByuglQ5JmJzGtVS5nqiPGNYgi EevJryRy6AEc56rAm7LuJQ61da1+bjeKDzB02KenuzIP9NnJWgd4l04LlhKc2AALl8Z9qP L0iT+Aarn+q2MQRgYcMh2H3P3dNHwEI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-136-cxClfif7OhqL8iEyLNs0RQ-1; Tue, 21 Apr 2020 09:51:43 -0400 X-MC-Unique: cxClfif7OhqL8iEyLNs0RQ-1 Received: by mail-wm1-f69.google.com with SMTP id l21so1483635wmh.2 for ; Tue, 21 Apr 2020 06:51:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ctzOqm9dtwbhRf44FvKp72RdNODJeokpu4mABLVWWLc=; b=UYXNxPBc1u/OXym83Io0TENq/8+b1IqmelUQZJhCRpe+HWmVPI/39CKhSGQSVy4N9g uYX+ktAcgje3/4OS3CX+nqcfC/XNtPkmpjupmKzY0qbtSLtiN+GB2MjZyz+0ddjjlxEP 2IpQFULTN/j3Ru2ylwvGlFAG2+RyVFOjPvKEm4p0HCWENLCkVN96nkczKAR3oPWmRsR2 CU/FqWir2bM6qiKdx15ZrCqgXAeGJDvxA8r4gWSlGmKfIlzmbvWNpNvYOIy3syJBXZOl Bt/VrnDYVffXBnKsD7EmQ+6Mxf4duLBerrmbPbYn3QD/ZxPmQc4/5+B1tggMsRRKZlLi i/hw== X-Gm-Message-State: AGi0PuZ+X82uWk0pyUxIyy6375jQuIxO4hSuOXhXwEpbLaLPh3AhSIM/ GXmiAmT/q2Y8Gl46gAeJs7s2ihP7xyUzsQEpqHjOVYsnUjQZo9qTPtoEhz0uCyfzIoDrhoIHMMK V/KV+DEHZtId/PEBOqRkfU2lpaDaK X-Received: by 2002:adf:fd0a:: with SMTP id e10mr23759649wrr.160.1587477102569; Tue, 21 Apr 2020 06:51:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKYYb14rVpuN5IdJGjcztA4u7H/3dUDNtMGXdL7LsdIhh9n0qcoiv0NvYygrC3tIbBHwPH97A== X-Received: by 2002:adf:fd0a:: with SMTP id e10mr23759618wrr.160.1587477102414; Tue, 21 Apr 2020 06:51:42 -0700 (PDT) Received: from localhost.localdomain.com ([194.230.155.194]) by smtp.gmail.com with ESMTPSA id a187sm3565830wmh.40.2020.04.21.06.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:51:41 -0700 (PDT) From: Emanuele Giuseppe Esposito To: linux-fsdevel@vger.kernel.org Subject: [PATCH v2 1/7] apparmor: just use vfs_kern_mount to make .null Date: Tue, 21 Apr 2020 15:51:13 +0200 Message-Id: <20200421135119.30007-2-eesposit@redhat.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200421135119.30007-1-eesposit@redhat.com> References: <20200421135119.30007-1-eesposit@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , David Airlie , dri-devel@lists.freedesktop.org, Christoph Hellwig , Andrew Donnellan , Emanuele Giuseppe Esposito , linux-scsi@vger.kernel.org, James Morris , "Serge E. Hallyn" , Arnd Bergmann , "James E.J. Bottomley" , "Manoj N. Kumar" , Alexander Viro , "Matthew R. Ochs" , Uma Krishnan , John Johansen , "Martin K. Petersen" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Thomas Zimmermann , Frederic Barrat , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, Joel Becker Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" aa_mk_null_file is using simple_pin_fs/simple_release_fs with local variables as arguments, for what would amount to a simple vfs_kern_mount/mntput pair if everything was inlined. Just use the normal filesystem API since the reference counting is not needed here (it is a local variable and always 0 on entry and on exit). There is no functional change intended. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 280741fc0f5f..36f848734902 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,15 @@ struct path aa_null; static int aa_mk_null_file(struct dentry *parent) { - struct vfsmount *mount = NULL; + struct file_system_type *type = parent->d_sb->s_type; + struct vfsmount *mount; struct dentry *dentry; struct inode *inode; - int count = 0; - int error = simple_pin_fs(parent->d_sb->s_type, &mount, &count); + int error; - if (error) - return error; + mount = vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL); + if (IS_ERR(mount)) + return PTR_ERR(mount); inode_lock(d_inode(parent)); dentry = lookup_one_len(NULL_FILE_NAME, parent, strlen(NULL_FILE_NAME)); @@ -2561,7 +2562,7 @@ static int aa_mk_null_file(struct dentry *parent) dput(dentry); out: inode_unlock(d_inode(parent)); - simple_release_fs(&mount, &count); + mntput(mount); return error; } -- 2.25.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel