From nobody Fri Sep 12 00:30:57 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB494C636CC for ; Wed, 15 Feb 2023 13:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjBONjA (ORCPT ); Wed, 15 Feb 2023 08:39:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjBONi6 (ORCPT ); Wed, 15 Feb 2023 08:38:58 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701C77D88; Wed, 15 Feb 2023 05:38:57 -0800 (PST) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 1EFC02147; Wed, 15 Feb 2023 13:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676468085; bh=v58AXW2jaHRye0+maSOsTkJ3+nH0kdM/rFc7zhel7Rc=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=W4yAraG/LFxRU1llz2bytqvNtGnqOkDAsNUSflnIdSqi2WB4dmyV07Vp9gmL7aBzA RLOcoQ3v00omyOCC4OtsDJzX//VF+mkYcGp8YdRXKA+jBpvUt5L+mV6diBi5Di8M9R azxBZlm0LhyBv5C1t8ozsOdC6sfk0D8cjgvL7yic= Received: from [192.168.211.36] (192.168.211.36) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 15 Feb 2023 16:38:55 +0300 Message-ID: <2f017ba3-78a9-211d-2a61-f8a1c90c3cab@paragon-software.com> Date: Wed, 15 Feb 2023 17:38:54 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 08/11] fs/ntfs3: Changed ntfs_get_acl() to use dentry Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.36] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ntfs_get_acl changed to match new interface in struct inode_operations. Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/file.c=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- =C2=A0fs/ntfs3/namei.c=C2=A0=C2=A0 |=C2=A0 4 ++-- =C2=A0fs/ntfs3/ntfs_fs.h |=C2=A0 3 ++- =C2=A0fs/ntfs3/xattr.c=C2=A0=C2=A0 | 26 +++++++++----------------- =C2=A04 files changed, 14 insertions(+), 21 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index df7b76d1c127..09b7931e6be3 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -1143,7 +1143,7 @@ const struct inode_operations=20 ntfs_file_inode_operations =3D { =C2=A0=C2=A0=C2=A0 =C2=A0.getattr=C2=A0=C2=A0 =C2=A0=3D ntfs_getattr, =C2=A0=C2=A0=C2=A0 =C2=A0.setattr=C2=A0=C2=A0 =C2=A0=3D ntfs3_setattr, =C2=A0=C2=A0=C2=A0 =C2=A0.listxattr=C2=A0=C2=A0 =C2=A0=3D ntfs_listxattr, -=C2=A0=C2=A0 =C2=A0.get_inode_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, +=C2=A0=C2=A0 =C2=A0.get_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, =C2=A0=C2=A0=C2=A0 =C2=A0.set_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_set_acl, =C2=A0=C2=A0=C2=A0 =C2=A0.fiemap=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=3D = ntfs_fiemap, =C2=A0}; diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 5d5fe2f1f77c..8b68ead5cc1f 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -607,7 +607,7 @@ const struct inode_operations=20 ntfs_dir_inode_operations =3D { =C2=A0=C2=A0=C2=A0 =C2=A0.rmdir=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=3D n= tfs_rmdir, =C2=A0=C2=A0=C2=A0 =C2=A0.mknod=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=3D n= tfs_mknod, =C2=A0=C2=A0=C2=A0 =C2=A0.rename=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=3D = ntfs_rename, -=C2=A0=C2=A0 =C2=A0.get_inode_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, +=C2=A0=C2=A0 =C2=A0.get_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, =C2=A0=C2=A0=C2=A0 =C2=A0.set_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_set_acl, =C2=A0=C2=A0=C2=A0 =C2=A0.setattr=C2=A0=C2=A0 =C2=A0=3D ntfs3_setattr, =C2=A0=C2=A0=C2=A0 =C2=A0.getattr=C2=A0=C2=A0 =C2=A0=3D ntfs_getattr, @@ -620,7 +620,7 @@ const struct inode_operations=20 ntfs_special_inode_operations =3D { =C2=A0=C2=A0=C2=A0 =C2=A0.setattr=C2=A0=C2=A0 =C2=A0=3D ntfs3_setattr, =C2=A0=C2=A0=C2=A0 =C2=A0.getattr=C2=A0=C2=A0 =C2=A0=3D ntfs_getattr, =C2=A0=C2=A0=C2=A0 =C2=A0.listxattr=C2=A0=C2=A0 =C2=A0=3D ntfs_listxattr, -=C2=A0=C2=A0 =C2=A0.get_inode_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, +=C2=A0=C2=A0 =C2=A0.get_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_get_acl, =C2=A0=C2=A0=C2=A0 =C2=A0.set_acl=C2=A0=C2=A0 =C2=A0=3D ntfs_set_acl, =C2=A0}; diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 26957dbfe471..b7782107ce8a 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -855,7 +855,8 @@ unsigned long ntfs_names_hash(const u16 *name,=20 size_t len, const u16 *upcase, =C2=A0/* globals from xattr.c */ =C2=A0#ifdef CONFIG_NTFS3_FS_POSIX_ACL -struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu); +struct posix_acl *ntfs_get_acl(struct user_namespace *mnt_userns, +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 struct dentry *dentry, int type); =C2=A0int ntfs_set_acl(struct user_namespace *mnt_userns, struct dentry *d= entry, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 struct posix_acl *acl, int ty= pe); =C2=A0int ntfs_init_acl(struct user_namespace *mnt_userns, struct inode *i= node, diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index e7a66225361d..95c479d7ebba 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -520,9 +520,14 @@ static noinline int ntfs_set_ea(struct inode=20 *inode, const char *name, =C2=A0} =C2=A0#ifdef CONFIG_NTFS3_FS_POSIX_ACL -static struct posix_acl *ntfs_get_acl_ex(struct inode *inode, int type, -=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0 int locked) + +/* + * ntfs_get_acl - inode_operations::get_acl + */ +struct posix_acl *ntfs_get_acl(struct user_namespace *mnt_userns, +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 struct dentry *dentry, int type) =C2=A0{ +=C2=A0=C2=A0 =C2=A0struct inode *inode =3D d_inode(dentry); =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); =C2=A0=C2=A0=C2=A0 =C2=A0const char *name; =C2=A0=C2=A0=C2=A0 =C2=A0size_t name_len; @@ -545,13 +550,11 @@ static struct posix_acl *ntfs_get_acl_ex(struct=20 inode *inode, int type, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0name_len =3D sizeof(XATTR_NAME= _POSIX_ACL_DEFAULT) - 1; =C2=A0=C2=A0=C2=A0 =C2=A0} -=C2=A0=C2=A0 =C2=A0if (!locked) -=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ni_lock(ni); +=C2=A0=C2=A0 =C2=A0ni_lock(ni); =C2=A0=C2=A0=C2=A0 =C2=A0err =3D ntfs_get_ea(inode, name, name_len, buf, P= ATH_MAX, &req); -=C2=A0=C2=A0 =C2=A0if (!locked) -=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ni_unlock(ni); +=C2=A0=C2=A0 =C2=A0ni_unlock(ni); =C2=A0=C2=A0=C2=A0 =C2=A0/* Translate extended attribute to acl. */ =C2=A0=C2=A0=C2=A0 =C2=A0if (err >=3D 0) { @@ -570,17 +573,6 @@ static struct posix_acl *ntfs_get_acl_ex(struct=20 inode *inode, int type, =C2=A0=C2=A0=C2=A0 =C2=A0return acl; =C2=A0} -/* - * ntfs_get_acl - inode_operations::get_acl - */ -struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu) -{ -=C2=A0=C2=A0 =C2=A0if (rcu) -=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return ERR_PTR(-ECHILD); - -=C2=A0=C2=A0 =C2=A0return ntfs_get_acl_ex(inode, type, 0); -} - =C2=A0static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_usern= s, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0=C2=A0 struct inode *inode, struct posix_acl *acl, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0=C2=A0 int type, bool init_acl) --=20 2.34.1