linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs-idmapping tree with Linus' tree
@ 2023-01-29 23:31 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2023-01-29 23:31 UTC (permalink / raw)
  To: Christian Brauner, Seth Forshee
  Cc: Christian Brauner, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 5110 bytes --]

Hi all,

Today's linux-next merge of the vfs-idmapping tree got conflicts in:

  fs/fuse/acl.c
  fs/fuse/fuse_i.h
  fs/fuse/xattr.c

between commit:

  facd61053cff ("fuse: fixes after adapting to new posix acl api")

from Linus' tree and various commits from the vfs-idmapping tree.

Christian: thanks for supplying the resolution.

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/fuse/acl.c
index ad670369955f,23d1c263891f..000000000000
--- a/fs/fuse/acl.c
+++ b/fs/fuse/acl.c
@@@ -11,10 -11,9 +11,10 @@@
  #include <linux/posix_acl.h>
  #include <linux/posix_acl_xattr.h>
  
 -struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu)
 +static struct posix_acl *__fuse_get_acl(struct fuse_conn *fc,
- 					struct user_namespace *mnt_userns,
++					struct mnt_idmap *idmap,
 +					struct inode *inode, int type, bool rcu)
  {
 -	struct fuse_conn *fc = get_fuse_conn(inode);
  	int size;
  	const char *name;
  	void *value = NULL;
@@@ -54,47 -53,7 +54,47 @@@
  	return acl;
  }
  
 +static inline bool fuse_no_acl(const struct fuse_conn *fc,
 +			       const struct inode *inode)
 +{
 +	/*
 +	 * Refuse interacting with POSIX ACLs for daemons that
 +	 * don't support FUSE_POSIX_ACL and are not mounted on
 +	 * the host to retain backwards compatibility.
 +	 */
 +	return !fc->posix_acl && (i_user_ns(inode) != &init_user_ns);
 +}
 +
- struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns,
++struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap,
 +			       struct dentry *dentry, int type)
 +{
 +	struct inode *inode = d_inode(dentry);
 +	struct fuse_conn *fc = get_fuse_conn(inode);
 +
 +	if (fuse_no_acl(fc, inode))
 +		return ERR_PTR(-EOPNOTSUPP);
 +
- 	return __fuse_get_acl(fc, mnt_userns, inode, type, false);
++	return __fuse_get_acl(fc, idmap, inode, type, false);
 +}
 +
 +struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu)
 +{
 +	struct fuse_conn *fc = get_fuse_conn(inode);
 +
 +	/*
 +	 * FUSE daemons before FUSE_POSIX_ACL was introduced could get and set
 +	 * POSIX ACLs without them being used for permission checking by the
 +	 * vfs. Retain that behavior for backwards compatibility as there are
 +	 * filesystems that do all permission checking for acls in the daemon
 +	 * and not in the kernel.
 +	 */
 +	if (!fc->posix_acl)
 +		return NULL;
 +
- 	return __fuse_get_acl(fc, &init_user_ns, inode, type, rcu);
++	return __fuse_get_acl(fc, &nop_mnt_idmap, inode, type, rcu);
 +}
 +
- int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
+ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct posix_acl *acl, int type)
  {
  	struct inode *inode = d_inode(dentry);
@@@ -140,14 -99,8 +140,14 @@@
  			return ret;
  		}
  
 -		if (!vfsgid_in_group_p(i_gid_into_vfsgid(&nop_mnt_idmap, inode)) &&
 +		/*
 +		 * Fuse daemons without FUSE_POSIX_ACL never changed the passed
 +		 * through POSIX ACLs. Such daemons don't expect setgid bits to
 +		 * be stripped.
 +		 */
 +		if (fc->posix_acl &&
- 		    !vfsgid_in_group_p(i_gid_into_vfsgid(&init_user_ns, inode)) &&
- 		    !capable_wrt_inode_uidgid(&init_user_ns, inode, CAP_FSETID))
++		    !vfsgid_in_group_p(i_gid_into_vfsgid(&nop_mnt_idmap, inode)) &&
+ 		    !capable_wrt_inode_uidgid(&nop_mnt_idmap, inode, CAP_FSETID))
  			extra_flags |= FUSE_SETXATTR_ACL_KILL_SGID;
  
  		ret = fuse_setxattr(inode, name, value, size, 0, extra_flags);
diff --cc fs/fuse/fuse_i.h
index 46797a171a84,ee084cead402..000000000000
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@@ -1264,12 -1264,12 +1264,12 @@@ ssize_t fuse_getxattr(struct inode *ino
  ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size);
  int fuse_removexattr(struct inode *inode, const char *name);
  extern const struct xattr_handler *fuse_xattr_handlers[];
 -extern const struct xattr_handler *fuse_acl_xattr_handlers[];
 -extern const struct xattr_handler *fuse_no_acl_xattr_handlers[];
  
  struct posix_acl;
 -struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu);
 +struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu);
- struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns,
++struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap,
 +			       struct dentry *dentry, int type);
- int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
+ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct posix_acl *acl, int type);
  
  /* readdir.c */
diff --cc fs/fuse/xattr.c
index 9fe571ab569e,30aaaa4b3bfb..000000000000
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* linux-next: manual merge of the vfs-idmapping tree with Linus' tree
@ 2023-01-18 23:07 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2023-01-18 23:07 UTC (permalink / raw)
  To: Christian Brauner, Seth Forshee
  Cc: Christian Brauner (Microsoft),
	Christophe JAILLET, David Sterba, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

Hi all,

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

  fs/btrfs/inode.c

between commit:

  abe3bf7425fb ("btrfs: fix an error handling path in btrfs_rename()")

from Linus' tree and commit:

  7ddfa7d0d7d1 ("fs: port inode_init_owner() to mnt_idmap")

from the vfs-idmapping 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/btrfs/inode.c
index 98a800b8bd43,8d74d042c626..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -9376,11 -9376,9 +9376,11 @@@ static int btrfs_rename(struct mnt_idma
  		filemap_flush(old_inode->i_mapping);
  
  	if (flags & RENAME_WHITEOUT) {
- 		whiteout_args.inode = new_whiteout_inode(mnt_userns, old_dir);
+ 		whiteout_args.inode = new_whiteout_inode(idmap, old_dir);
 -		if (!whiteout_args.inode)
 -			return -ENOMEM;
 +		if (!whiteout_args.inode) {
 +			ret = -ENOMEM;
 +			goto out_fscrypt_names;
 +		}
  		ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items);
  		if (ret)
  			goto out_whiteout_inode;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-29 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29 23:31 linux-next: manual merge of the vfs-idmapping tree with Linus' tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-01-18 23:07 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).