From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Giuseppe Esposito Date: Tue, 14 Apr 2020 14:42:55 +0200 Subject: [Ocfs2-devel] [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null In-Reply-To: <20200414124304.4470-1-eesposit@redhat.com> References: <20200414124304.4470-1-eesposit@redhat.com> Message-ID: <20200414124304.4470-2-eesposit@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-nfs@vger.kernel.org Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Joseph Qi , Hugh Dickins , Paul Mackerras , John Johansen , linux-s390@vger.kernel.org, Christoph Hellwig , Andrew Donnellan , Emanuele Giuseppe Esposito , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Michael Ellerman , Mark Fasheh , Anton Vorontsov , John Fastabend , James Morris , Ard Biesheuvel , Jason Gunthorpe , Doug Ledford , oprofile-list@lists.sf.net, Yonghong Song , Ian Kent , Andrii Nakryiko , Alexey Dobriyan , "Serge E. Hallyn" , netdev@vger.kernel.org, Robert Richter , Thomas Zimmermann , Vasily Gorbik , Tony Luck , Kees Cook , "James E.J. Bottomley" , autofs@vger.kernel.org, Uma Krishnan , linux-fsdevel@vger.kernel.org, "Manoj N. Kumar" , Alexander Viro , Jakub Kicinski , KP Singh , Trond Myklebust , "Matthew R. Ochs" , "David S. Miller" , Felipe Balbi , Mike Marciniszyn , Iurii Zaikin , linux-scsi@vger.kernel.org, "Martin K. Petersen" , linux-mm@kvack.org, Greg Kroah-Hartman , Dennis Dalessandro , Miklos Szeredi , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Anna Schumaker , Luis Chamberlain , Chuck Lever , Jeremy Kerr , Colin Cross , Frederic Barrat , Paolo Bonzini , Andrew Morton , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , ocfs2-devel@oss.oracle.com, Joel Becker 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. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 280741fc0f5f..828bb1eb77ea 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,14 @@ 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); - 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 +2561,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 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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 AEDD9C2BA19 for ; Tue, 14 Apr 2020 12:43:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F9562075E for ; Tue, 14 Apr 2020 12:43:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OGC9aaPB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F9562075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EFAFD8E0005; Tue, 14 Apr 2020 08:43:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E83F88E0001; Tue, 14 Apr 2020 08:43:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFD1E8E0005; Tue, 14 Apr 2020 08:43:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id B7ED38E0001 for ; Tue, 14 Apr 2020 08:43:41 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7FB14181AEF21 for ; Tue, 14 Apr 2020 12:43:41 +0000 (UTC) X-FDA: 76706427042.22.bird96_2023aa6531a2a X-HE-Tag: bird96_2023aa6531a2a X-Filterd-Recvd-Size: 8000 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 12:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586868220; 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=s/11mAo8TGof9fElMW//bJCzL1+izMSi4fkBrEjCedo=; b=OGC9aaPB3eJbJJJodWQ/ggOsRegysFSbO+rmdY1NOQ+mdYzV2XkvKGWDcpB7pDsdKY5v+x 69J53yz4KyVvm2CDxckdaWjF/RnGGhX00pXZaTadAr6XPIo46YG45NZu8yLvy3r17Vzkg/ WsaiIoQkfv2wNN8wYsWbms1kYzhgojE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-hcZxQ2EIN1SDOnfW9ZimFQ-1; Tue, 14 Apr 2020 08:43:38 -0400 X-MC-Unique: hcZxQ2EIN1SDOnfW9ZimFQ-1 Received: by mail-wm1-f71.google.com with SMTP id f17so3710132wmm.5 for ; Tue, 14 Apr 2020 05:43:38 -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=MrMq7u1iV/F4rZQEqvhQ++V9yKrw5g/LWhjcaMYuCWg=; b=Q9/GvyuFfvhOEyX8nRjQ8r26b8gZf98fKPPjBue7wz230LRJl9Lv8zh5ZGsfBwlXQg 5dC9rsmCfL6hoiy0sJgf9o3R35IhtifUgfvDE8ty5BfIZkay83o47rp/5xLbg5zVvs1X 7bK1EFBRp4b+TKl4C+/JbBqnIs9ibKFXXdNFVGITuXaO9ut2+cvHda65QNc/AFjmv3le 5rD4PLkiYZg1ZYNnyT4AHiyDfnj+v7Hxujn51fSRRP8tEnnX+VTZ2PCT8uCTrLkWUN+j f7lmsY4cwofBpq15uWyqP6MQtiZ9edl+S7DiBrRCgzi55Bptg16Afhc3hyLRXpkyB6Bq s1HQ== X-Gm-Message-State: AGi0PubI1ZEF40p/RAPaBSM04OKn3jPQqCrMxKkIh1Mb97JIVveUxSdj 0c2J58odwtuWYL1ugApOCDn58coFibF7Z1L+vup0BaP6cSnTTV8mIWdpfI0Trc3+eLtI+mJA/fm olHWLyhBtBU0= X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691195wrp.275.1586868217662; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKieMHQMEHB64fOusIKVI0klz9UQdQ5a1y3lFWKhJD37VUle4YhX0YmwupcDiJWC0mdvqWDbw== X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691124wrp.275.1586868217421; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.210]) by smtp.gmail.com with ESMTPSA id m14sm16948816wrs.76.2020.04.14.05.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:43:36 -0700 (PDT) From: Emanuele Giuseppe Esposito To: linux-nfs@vger.kernel.org Cc: Paolo Bonzini , Emanuele Giuseppe Esposito , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Dennis Dalessandro , Mike Marciniszyn , Doug Ledford , Jason Gunthorpe , Frederic Barrat , Andrew Donnellan , Greg Kroah-Hartman , Robert Richter , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , Alexander Viro , Ian Kent , Joel Becker , Christoph Hellwig , "Rafael J. Wysocki" , Matthew Garrett , Ard Biesheuvel , Miklos Szeredi , Mike Kravetz , Mark Fasheh , Joseph Qi , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Iurii Zaikin , Anton Vorontsov , Colin Cross , Tony Luck , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Hugh Dickins , Andrew Morton , "J. Bruce Fields" , Chuck Lever , Trond Myklebust , Anna Schumaker , "David S. Miller" , Jakub Kicinski , James Morris , "Serge E. Hallyn" , John Johansen , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, oprofile-list@lists.sf.net, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, linux-fsdevel@vger.kernel.org, autofs@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null Date: Tue, 14 Apr 2020 14:42:55 +0200 Message-Id: <20200414124304.4470-2-eesposit@redhat.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200414124304.4470-1-eesposit@redhat.com> References: <20200414124304.4470-1-eesposit@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.= c index 280741fc0f5f..828bb1eb77ea 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,14 @@ struct path aa_null; =20 static int aa_mk_null_file(struct dentry *parent) { -=09struct vfsmount *mount =3D NULL; +=09struct file_system_type *type =3D parent->d_sb->s_type; +=09struct vfsmount *mount; =09struct dentry *dentry; =09struct inode *inode; -=09int count =3D 0; -=09int error =3D simple_pin_fs(parent->d_sb->s_type, &mount, &count); =20 -=09if (error) -=09=09return error; +=09mount =3D vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL); +=09if (IS_ERR(mount)) +=09=09return PTR_ERR(mount); =20 =09inode_lock(d_inode(parent)); =09dentry =3D lookup_one_len(NULL_FILE_NAME, parent, strlen(NULL_FILE_NAME= )); @@ -2561,7 +2561,7 @@ static int aa_mk_null_file(struct dentry *parent) =09dput(dentry); out: =09inode_unlock(d_inode(parent)); -=09simple_release_fs(&mount, &count); +=09mntput(mount); =09return error; } =20 --=20 2.25.2 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,USER_AGENT_GIT autolearn=unavailable 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 37369C2BA19 for ; Tue, 14 Apr 2020 13:00:47 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 D641120732 for ; Tue, 14 Apr 2020 13:00:46 +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="OGC9aaPB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D641120732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 491lwD68SNzDqBV for ; Tue, 14 Apr 2020 23:00:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=207.211.31.120; helo=us-smtp-1.mimecast.com; envelope-from=eesposit@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGC9aaPB; dkim-atps=neutral Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 491lXZ6MJKzDqcl for ; Tue, 14 Apr 2020 22:43:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586868220; 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=s/11mAo8TGof9fElMW//bJCzL1+izMSi4fkBrEjCedo=; b=OGC9aaPB3eJbJJJodWQ/ggOsRegysFSbO+rmdY1NOQ+mdYzV2XkvKGWDcpB7pDsdKY5v+x 69J53yz4KyVvm2CDxckdaWjF/RnGGhX00pXZaTadAr6XPIo46YG45NZu8yLvy3r17Vzkg/ WsaiIoQkfv2wNN8wYsWbms1kYzhgojE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-Vt8KjghqOX2BGctdWg4dvg-1; Tue, 14 Apr 2020 08:43:38 -0400 X-MC-Unique: Vt8KjghqOX2BGctdWg4dvg-1 Received: by mail-wm1-f72.google.com with SMTP id c129so3705173wme.8 for ; Tue, 14 Apr 2020 05:43:38 -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=MrMq7u1iV/F4rZQEqvhQ++V9yKrw5g/LWhjcaMYuCWg=; b=MiumkRTegqZCym5hFrG/HlnfJQrkfTw9d7tC1bsKOMqV1a5ZcYTQlyBZYHjPbBjC7u qRpiyoZ/NBWe1x4TGYmj31E/+BXfJnq9IyIDW6rVQnzHOjp7Z2DarNWpUe6wVcEJOvIJ KneQI1pGttTfN/ATR9/w3RdR1jn12azS/jsHH36ZzLrOEckQOzuwlUhQNos+qUigPViK 1RfRYDLXf+9JhNStyxFC45rJjqZ+Xpm873UdpSjTefGeRPkXX94OkNjGyaHsu7O4Ap0Y kB+/gXXdT99eE3MmXERZVbBLd2f42e4KetJEiUSZ1rs6vVHiFSzWggxNXekpEWISEW82 uM9g== X-Gm-Message-State: AGi0PuZKicobrDPyVW0UdnSziSuhc1kHAHuioc88eLR9BaloXsFV8wRh vNGvshWurRtG1PGQwd7XxgkO9ZTqQrA2C763DxB0RQrF0fi+AP6KoIWKVJs7gPojFdlWk+tlxoJ dHU7aMDbsr/+Kz/bRHxgtsXcpHw== X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691205wrp.275.1586868217664; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKieMHQMEHB64fOusIKVI0klz9UQdQ5a1y3lFWKhJD37VUle4YhX0YmwupcDiJWC0mdvqWDbw== X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691124wrp.275.1586868217421; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.210]) by smtp.gmail.com with ESMTPSA id m14sm16948816wrs.76.2020.04.14.05.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:43:36 -0700 (PDT) From: Emanuele Giuseppe Esposito To: linux-nfs@vger.kernel.org Subject: [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null Date: Tue, 14 Apr 2020 14:42:55 +0200 Message-Id: <20200414124304.4470-2-eesposit@redhat.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200414124304.4470-1-eesposit@redhat.com> References: <20200414124304.4470-1-eesposit@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 14 Apr 2020 22:51:49 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Joseph Qi , Hugh Dickins , Paul Mackerras , John Johansen , netdev@vger.kernel.org, linux-s390@vger.kernel.org, Christoph Hellwig , Andrew Donnellan , Emanuele Giuseppe Esposito , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Mark Fasheh , Anton Vorontsov , John Fastabend , James Morris , Ard Biesheuvel , Jason Gunthorpe , Doug Ledford , oprofile-list@lists.sf.net, Yonghong Song , Ian Kent , Andrii Nakryiko , Alexey Dobriyan , "Serge E. Hallyn" , Robert Richter , Thomas Zimmermann , Vasily Gorbik , Tony Luck , Kees Cook , "James E.J. Bottomley" , autofs@vger.kernel.org, Maarten Lankhorst , Uma Krishnan , Maxime Ripard , linux-fsdevel@vger.kernel.org, "Manoj N. Kumar" , Alexander Viro , Jakub Kicinski , KP Singh , Trond Myklebust , "Matthew R. Ochs" , "David S. Miller" , Felipe Balbi , Mike Marciniszyn , Iurii Zaikin , linux-scsi@vger.kernel.org, "Martin K. Petersen" , linux-mm@kvack.org, Greg Kroah-Hartman , Dennis Dalessandro , Miklos Szeredi , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Anna Schumaker , Luis Chamberlain , Chuck Lever , Jeremy Kerr , Daniel Vetter , Colin Cross , Frederic Barrat , Paolo Bonzini , Andrew Morton , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , ocfs2-devel@oss.oracle.com, Joel Becker Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.= c index 280741fc0f5f..828bb1eb77ea 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,14 @@ struct path aa_null; =20 static int aa_mk_null_file(struct dentry *parent) { -=09struct vfsmount *mount =3D NULL; +=09struct file_system_type *type =3D parent->d_sb->s_type; +=09struct vfsmount *mount; =09struct dentry *dentry; =09struct inode *inode; -=09int count =3D 0; -=09int error =3D simple_pin_fs(parent->d_sb->s_type, &mount, &count); =20 -=09if (error) -=09=09return error; +=09mount =3D vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL); +=09if (IS_ERR(mount)) +=09=09return PTR_ERR(mount); =20 =09inode_lock(d_inode(parent)); =09dentry =3D lookup_one_len(NULL_FILE_NAME, parent, strlen(NULL_FILE_NAME= )); @@ -2561,7 +2561,7 @@ static int aa_mk_null_file(struct dentry *parent) =09dput(dentry); out: =09inode_unlock(d_inode(parent)); -=09simple_release_fs(&mount, &count); +=09mntput(mount); =09return error; } =20 --=20 2.25.2 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 89BC2C2BA19 for ; Tue, 14 Apr 2020 12:43:45 +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 5918A2076B for ; Tue, 14 Apr 2020 12:43:45 +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="ALw5Ft5d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5918A2076B 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 C00456E0D6; Tue, 14 Apr 2020 12:43:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 880DC6E0D6 for ; Tue, 14 Apr 2020 12:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586868222; 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=s/11mAo8TGof9fElMW//bJCzL1+izMSi4fkBrEjCedo=; b=ALw5Ft5dgyyrPraXzC1Neg344EB8b2niHePQgfXnMXUflTbuedjCJ+RpSuNV1rRUS2TqKw A9i1AZVFFbJpPodGITQa8bF488DADOManm+Y296MzaYEqMbJWi5jsFIaHSn2uLpezeX2Bb hkwtl+ZaxQKxn2k9Qd/3A2JrI282r3s= 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-482-3TcPw2tPN7GiGaMJZ65UPQ-1; Tue, 14 Apr 2020 08:43:38 -0400 X-MC-Unique: 3TcPw2tPN7GiGaMJZ65UPQ-1 Received: by mail-wm1-f69.google.com with SMTP id f128so2557559wmf.8 for ; Tue, 14 Apr 2020 05:43:38 -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=MrMq7u1iV/F4rZQEqvhQ++V9yKrw5g/LWhjcaMYuCWg=; b=PA6OcAm+Yx2Vh9oRKY4ItMxfy5IPx355DXmps/l/MPDTWkLyJxLeRxZGen5A1FvTCI GuayxzUH/rlmrx7j4KY3Azb2rh0I/t3xuSq18tICYSY/aAggqqqwxlulFgdQjLNl+AoP dBOOfz0dlvBI4J/PIqP8sM6p6ETcgaZ2AWCMGBzEdHnUYQRD3hEZY4pERQm6+PdarhyG M/rnOl7P7uDNiOqNgAUaH6BkcwWxIIxEkEcV0+PTXKwjGHF+Om40UkQD00MikNeJCjLi RvUeQOhtUCfneeu0XnAkWdbsJwHANR2sBIW35tnioDt3tSa3U6mJ/pc+XY2qQyvQOeCV +KcQ== X-Gm-Message-State: AGi0PuarwiO1jaf7dIBtU+cPQw2ASnMXw3rteLq1wDjXRdycDHyLjdIN HFi1yYPpq+EG59OIl/ufvO2cJDxNCy4uGP70B0WSzI75yG/eM9N3JRzvTrAMmUdVFKX7K57dxAw /EiSxvo/LwfsmxHZbIHLuzEXh+DEa X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691201wrp.275.1586868217663; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKieMHQMEHB64fOusIKVI0klz9UQdQ5a1y3lFWKhJD37VUle4YhX0YmwupcDiJWC0mdvqWDbw== X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691124wrp.275.1586868217421; Tue, 14 Apr 2020 05:43:37 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.210]) by smtp.gmail.com with ESMTPSA id m14sm16948816wrs.76.2020.04.14.05.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:43:36 -0700 (PDT) From: Emanuele Giuseppe Esposito To: linux-nfs@vger.kernel.org Subject: [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null Date: Tue, 14 Apr 2020 14:42:55 +0200 Message-Id: <20200414124304.4470-2-eesposit@redhat.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200414124304.4470-1-eesposit@redhat.com> References: <20200414124304.4470-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: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Joseph Qi , Hugh Dickins , Paul Mackerras , John Johansen , linux-s390@vger.kernel.org, Christoph Hellwig , Andrew Donnellan , Emanuele Giuseppe Esposito , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Michael Ellerman , Mark Fasheh , Anton Vorontsov , John Fastabend , James Morris , Ard Biesheuvel , Jason Gunthorpe , Doug Ledford , oprofile-list@lists.sf.net, Yonghong Song , Ian Kent , Andrii Nakryiko , Alexey Dobriyan , "Serge E. Hallyn" , netdev@vger.kernel.org, Robert Richter , Thomas Zimmermann , Vasily Gorbik , Tony Luck , Kees Cook , "James E.J. Bottomley" , autofs@vger.kernel.org, Uma Krishnan , linux-fsdevel@vger.kernel.org, "Manoj N. Kumar" , Alexander Viro , Jakub Kicinski , KP Singh , Trond Myklebust , "Matthew R. Ochs" , "David S. Miller" , Felipe Balbi , Mike Marciniszyn , Iurii Zaikin , linux-scsi@vger.kernel.org, "Martin K. Petersen" , linux-mm@kvack.org, Greg Kroah-Hartman , Dennis Dalessandro , Miklos Szeredi , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Anna Schumaker , Luis Chamberlain , Chuck Lever , Jeremy Kerr , Colin Cross , Frederic Barrat , Paolo Bonzini , Andrew Morton , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , ocfs2-devel@oss.oracle.com, 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. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 280741fc0f5f..828bb1eb77ea 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,14 @@ 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); - 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 +2561,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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Giuseppe Esposito Subject: [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null Date: Tue, 14 Apr 2020 14:42:55 +0200 Message-ID: <20200414124304.4470-2-eesposit@redhat.com> References: <20200414124304.4470-1-eesposit@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586868220; 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=s/11mAo8TGof9fElMW//bJCzL1+izMSi4fkBrEjCedo=; b=OGC9aaPB3eJbJJJodWQ/ggOsRegysFSbO+rmdY1NOQ+mdYzV2XkvKGWDcpB7pDsdKY5v+x 69J53yz4KyVvm2CDxckdaWjF/RnGGhX00pXZaTadAr6XPIo46YG45NZu8yLvy3r17Vzkg/ WsaiIoQkfv2wNN8wYsWbms1kYzhgojE= In-Reply-To: <20200414124304.4470-1-eesposit@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane-mx.org@lists.ozlabs.org Sender: "Linuxppc-dev" Content-Type: text/plain; charset="us-ascii" To: linux-nfs@vger.kernel.org Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Joseph Qi , Hugh Dickins , Paul Mackerras , John Johansen , netdev@vger.kernel.org, linux-s390@vger.kernel.org, Christoph Hellwig , Andrew Donnellan , Emanuele Giuseppe Esposito , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Mark Fasheh 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. Signed-off-by: Emanuele Giuseppe Esposito --- security/apparmor/apparmorfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.= c index 280741fc0f5f..828bb1eb77ea 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -2525,14 +2525,14 @@ struct path aa_null; =20 static int aa_mk_null_file(struct dentry *parent) { -=09struct vfsmount *mount =3D NULL; +=09struct file_system_type *type =3D parent->d_sb->s_type; +=09struct vfsmount *mount; =09struct dentry *dentry; =09struct inode *inode; -=09int count =3D 0; -=09int error =3D simple_pin_fs(parent->d_sb->s_type, &mount, &count); =20 -=09if (error) -=09=09return error; +=09mount =3D vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL); +=09if (IS_ERR(mount)) +=09=09return PTR_ERR(mount); =20 =09inode_lock(d_inode(parent)); =09dentry =3D lookup_one_len(NULL_FILE_NAME, parent, strlen(NULL_FILE_NAME= )); @@ -2561,7 +2561,7 @@ static int aa_mk_null_file(struct dentry *parent) =09dput(dentry); out: =09inode_unlock(d_inode(parent)); -=09simple_release_fs(&mount, &count); +=09mntput(mount); =09return error; } =20 --=20 2.25.2