Subject: linux-next: manual merge of the ntfs3 tree with the vfs-idmapping tree

From: Stephen Rothwell <[email-masked]>
Date: Thu, 16 Feb 2023 08:57:33 +1100

Hi all,

Today's linux-next merge of the ntfs3 tree got a conflict in:

  fs/ntfs3/ntfs_fs.h
  fs/ntfs3/xattr.c

between commits:

  77435322777d ("fs: port ->get_acl() to pass mnt_idmap")
  13e83a4923be ("fs: port ->set_acl() to pass mnt_idmap")
  4609e1f18e19 ("fs: port ->permission() to pass mnt_idmap")

from the vfs-idmapping tree and commits:

  d1468d48fe7a ("fs/ntfs3: Remove noacsrules")
  fa578fb1810a ("fs/ntfs3: Changed ntfs_get_acl() to use dentry")

from the ntfs3 tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/ntfs3/ntfs_fs.h
index 80072e5f96f7,9a2d965f183e..000000000000
--- a/fs/ntfs3/ntfs_fs.h
+++ b/fs/ntfs3/ntfs_fs.h
@@@ -858,19 -854,18 +856,18 @@@ unsigned long ntfs_names_hash(const u1
  
  /* globals from xattr.c */
  #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,
++struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
+ 			       struct dentry *dentry, int type);
 -int ntfs_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
 +int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct posix_acl *acl, int type);
 -int ntfs_init_acl(struct user_namespace *mnt_userns, struct inode *inode,
 +int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
  		  struct inode *dir);
  #else
  #define ntfs_get_acl NULL
  #define ntfs_set_acl NULL
  #endif
  
 -int ntfs_acl_chmod(struct user_namespace *mnt_userns, struct dentry *dentry);
 +int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry);
- int ntfs_permission(struct mnt_idmap *idmap, struct inode *inode,
- 		    int mask);
  ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
  extern const struct xattr_handler *ntfs_xattr_handlers[];
  
diff --cc fs/ntfs3/xattr.c
index ff64302e87e5,0a6d2ec8c340..000000000000
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@@ -517,9 -520,14 +520,14 @@@ out
  }
  
  #ifdef CONFIG_NTFS3_FS_POSIX_ACL
- static struct posix_acl *ntfs_get_acl_ex(struct inode *inode, int type,
- 					 int locked)
+ 
+ /*
+  * ntfs_get_acl - inode_operations::get_acl
+  */
 -struct posix_acl *ntfs_get_acl(struct user_namespace *mnt_userns,
++struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
+ 			       struct dentry *dentry, int type)
  {
+ 	struct inode *inode = d_inode(dentry);
  	struct ntfs_inode *ni = ntfs_i(inode);
  	const char *name;
  	size_t name_len;
@@@ -567,18 -573,7 +573,7 @@@
  	return acl;
  }
  
- /*
-  * ntfs_get_acl - inode_operations::get_acl
-  */
- struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu)
- {
- 	if (rcu)
- 		return ERR_PTR(-ECHILD);
- 
- 	return ntfs_get_acl_ex(inode, type, 0);
- }
- 
 -static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns,
 +static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap,
  				    struct inode *inode, struct posix_acl *acl,
  				    int type, bool init_acl)
  {
@@@ -708,23 -703,9 +703,9 @@@ int ntfs_acl_chmod(struct mnt_idmap *id
  	if (S_ISLNK(inode->i_mode))
  		return -EOPNOTSUPP;
  
 -	return posix_acl_chmod(mnt_userns, dentry, inode->i_mode);
 +	return posix_acl_chmod(idmap, dentry, inode->i_mode);
  }
  
- /*
-  * ntfs_permission - inode_operations::permission
-  */
- int ntfs_permission(struct mnt_idmap *idmap, struct inode *inode,
- 		    int mask)
- {
- 	if (ntfs_sb(inode->i_sb)->options->noacsrules) {
- 		/* "No access rules" mode - Allow all changes. */
- 		return 0;
- 	}
- 
- 	return generic_permission(idmap, inode, mask);
- }
- 
  /*
   * ntfs_listxattr - inode_operations::listxattr
   */