From patchwork Tue Apr 14 12:42:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 11487475 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBDF7912 for ; Tue, 14 Apr 2020 12:48:39 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (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 C88C0206A2 for ; Tue, 14 Apr 2020 12:48:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C88C0206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03EChJ4v151145; Tue, 14 Apr 2020 12:48:31 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 30b6hpmc0p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 12:48:31 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECfp7W054699; Tue, 14 Apr 2020 12:48:31 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 30bqchjqde-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Tue, 14 Apr 2020 12:48:31 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1jOKwL-0003aN-55; Tue, 14 Apr 2020 05:45:21 -0700 Received: from aserp3030.oracle.com ([141.146.126.71]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1jOKus-0003R3-7g for ocfs2-devel@oss.oracle.com; Tue, 14 Apr 2020 05:43:50 -0700 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECh7lY141759 for ; Tue, 14 Apr 2020 12:43:50 GMT Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by aserp3030.oracle.com with ESMTP id 30ctaa37xf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 14 Apr 2020 12:43:49 +0000 Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECcshf020974 for ; Tue, 14 Apr 2020 12:43:49 GMT Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by userp2030.oracle.com with ESMTP id 30d6wj6283-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK) for ; Tue, 14 Apr 2020 12:43:48 +0000 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-151-Ss3v5CKyPm6ghQ7z6o3Jrw-1; Tue, 14 Apr 2020 08:43:39 -0400 X-MC-Unique: Ss3v5CKyPm6ghQ7z6o3Jrw-1 Received: by mail-wm1-f72.google.com with SMTP id f128so2557565wmf.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=Vc6VWjAB8ipkbobvWN5SXip8CkubS+Bsu9OI/NBCaDPew5yjr7R4fFKZIInhRoRi8D r8raHzGcuvyq419o7PupE0q5mnlvC0duL5xhgIxHa9Lnk6nm/nwRorjzsSLw/m4+pYVN A7GK07uDkwUtCBmJasGk3w+L92K7LE/EEXkCiSEjTHO5dFd23DfQSW7IBYJDcGFK58tO 3lc7hT3U6NdgyJRBgUfgd4mJ33WnMtc3BmnxxeTjTbdvrkHAOZPjDQyxnoASYTDFjthJ JQyIhzScq380DzZx/pLynRzWwTcwi3GFkzF+GTbClzUzUdNoPA/Khil3MFvK2HfXOIXN kX+A== X-Gm-Message-State: AGi0PuZxag7hdMkFUZ0o/81RQmJEZVAyOAcuCk9zvM4F+wksWL2KpjTE TYbffspEmvjBgZcdyBQLwZOYJTJMYcf9M1ppdUFYhoIhrq3Rfo+aId3Gl8bJDCPl56p+FK+0Oyz hSyDjM8CiZ153gyLN6XjH5A== X-Received: by 2002:adf:f34f:: with SMTP id e15mr18691157wrp.275.1586868217652; 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 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-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:13.111.0.0/16 ip4:136.147.128.0/20 ip4:136.147.176.0/20 ip4:148.105.8.0/21 ip4:149.72.0.0/16 ip4:149.96.1.26 ip4:149.96.13.2 ip4:149.96.132.2 ip4:149.96.133.2 ip4:149.96.14.2 ip4:149.96.194.2 ip4:149.96.195.2 ip4:149.96.2.26 include:spf1.redhat.com -all X-Proofpoint-SPF-VenPass: Allowed X-PDR: PASS X-Source-IP: 207.211.31.81 X-ServerName: us-smtp-2.mimecast.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:13.111.0.0/16 ip4:136.147.128.0/20 ip4:136.147.176.0/20 ip4:148.105.8.0/21 ip4:149.72.0.0/16 ip4:149.96.1.26 ip4:149.96.13.2 ip4:149.96.132.2 ip4:149.96.133.2 ip4:149.96.14.2 ip4:149.96.194.2 ip4:149.96.195.2 ip4:149.96.2.26 include:spf1.redhat.com -all X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=tap_spam_policies_safe policy=tap_spam_policies score=0 classifier= adjust=0 reason=safe scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 X-Spam: OrgSafeList X-SpamRule: orgsafelist X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=1 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 X-Mailman-Approved-At: Tue, 14 Apr 2020 05:45:19 -0700 Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Benjamin Herrenschmidt , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Hugh Dickins , Paul Mackerras , John Johansen , linux-s390@vger.kernel.org, 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 , 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, 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, 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 , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 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; }