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

Message ID 20230413144651.3519980-1-broonie@kernel.org
State New
Headers
Series linux-next: manual merge of the erofs tree with the vfs-idmapping tree |

Commit Message

Mark Brown April 13, 2023, 2:46 p.m. UTC
  Hi all,

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

  fs/erofs/xattr.c

between commit:

  a5488f29835c0 ("fs: simplify ->listxattr() implementation")

from the vfs-idmapping tree and commit:

  303f50cf89b24 ("erofs: handle long xattr name prefixes properly")

from the erofs 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.

+++ b/fs/erofs/xattr.c
@@@ -483,12 -517,28 +513,26 @@@ static int xattr_entrylist(struct xattr
  {
  	struct listxattr_iter *it =
  		container_of(_it, struct listxattr_iter, it);
- 	unsigned int prefix_len;
- 	const char *prefix;
+ 	unsigned int base_index = entry->e_name_index;
+ 	unsigned int prefix_len, infix_len = 0;
+ 	const char *prefix, *infix = NULL;
+ 	const struct xattr_handler *h;
+ 
+ 	if (entry->e_name_index & EROFS_XATTR_LONG_PREFIX) {
+ 		struct erofs_sb_info *sbi = EROFS_SB(_it->sb);
+ 		struct erofs_xattr_prefix_item *pf = sbi->xattr_prefixes +
+ 			(entry->e_name_index & EROFS_XATTR_LONG_PREFIX_MASK);
+ 
+ 		if (pf >= sbi->xattr_prefixes + sbi->xattr_prefix_count)
+ 			return 1;
+ 		infix = pf->prefix->infix;
+ 		infix_len = pf->infix_len;
+ 		base_index = pf->prefix->base_index;
+ 	}
  
- 	prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
- 	if (!prefix)
+ 	h = erofs_xattr_handler(base_index);
+ 	if (!h || (h->list && !h->list(it->dentry)))
  		return 1;
 -
 -	prefix = xattr_prefix(h);
  	prefix_len = strlen(prefix);
  
  	if (!it->buffer) {
  

Comments

Mark Brown April 13, 2023, 3:49 p.m. UTC | #1
On Thu, Apr 13, 2023 at 03:46:51PM +0100, broonie@kernel.org wrote:

> 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.

No, that's wrong.  This:

diff --cc fs/erofs/xattr.c
index 015462763bdd5,a04724c816e5f..0000000000000
--- a/fs/erofs/xattr.c
+++ b/fs/erofs/xattr.c
@@@ -483,12 -517,28 +513,25 @@@ static int xattr_entrylist(struct xattr
  {
  	struct listxattr_iter *it =
  		container_of(_it, struct listxattr_iter, it);
- 	unsigned int prefix_len;
- 	const char *prefix;
+ 	unsigned int base_index = entry->e_name_index;
+ 	unsigned int prefix_len, infix_len = 0;
+ 	const char *prefix, *infix = NULL;
 -	const struct xattr_handler *h;
+ 
+ 	if (entry->e_name_index & EROFS_XATTR_LONG_PREFIX) {
+ 		struct erofs_sb_info *sbi = EROFS_SB(_it->sb);
+ 		struct erofs_xattr_prefix_item *pf = sbi->xattr_prefixes +
+ 			(entry->e_name_index & EROFS_XATTR_LONG_PREFIX_MASK);
+ 
+ 		if (pf >= sbi->xattr_prefixes + sbi->xattr_prefix_count)
+ 			return 1;
+ 		infix = pf->prefix->infix;
+ 		infix_len = pf->infix_len;
+ 		base_index = pf->prefix->base_index;
+ 	}
  
- 	prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
 -	h = erofs_xattr_handler(base_index);
 -	if (!h || (h->list && !h->list(it->dentry)))
++	prefix = erofs_xattr_prefix(base_index, it->dentry);
 +	if (!prefix)
  		return 1;
 -
 -	prefix = xattr_prefix(h);
  	prefix_len = strlen(prefix);
  
  	if (!it->buffer) {
  
Gao Xiang April 13, 2023, 4:16 p.m. UTC | #2
Hi Mark,

On 2023/4/13 23:49, Mark Brown wrote:
> On Thu, Apr 13, 2023 at 03:46:51PM +0100, broonie@kernel.org wrote:
> 
>> 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.
> 
> No, that's wrong.  This:

Thanks.  Actually I didn't update the corresponind xattr patches (just
rebase some older commits, also I'd like to avoid in the future, but
sometimes it's impossible at least if some RVB is added...)

I think it could be resolved as before by Stephen:
https://lore.kernel.org/r/20230412101942.75e3efa9@canb.auug.org.au

And which looks the same as below:

> 
> diff --cc fs/erofs/xattr.c
> index 015462763bdd5,a04724c816e5f..0000000000000
> --- a/fs/erofs/xattr.c
> +++ b/fs/erofs/xattr.c
> @@@ -483,12 -517,28 +513,25 @@@ static int xattr_entrylist(struct xattr
>    {
>    	struct listxattr_iter *it =
>    		container_of(_it, struct listxattr_iter, it);
> - 	unsigned int prefix_len;
> - 	const char *prefix;
> + 	unsigned int base_index = entry->e_name_index;
> + 	unsigned int prefix_len, infix_len = 0;
> + 	const char *prefix, *infix = NULL;
>   -	const struct xattr_handler *h;
> +
> + 	if (entry->e_name_index & EROFS_XATTR_LONG_PREFIX) {
> + 		struct erofs_sb_info *sbi = EROFS_SB(_it->sb);
> + 		struct erofs_xattr_prefix_item *pf = sbi->xattr_prefixes +
> + 			(entry->e_name_index & EROFS_XATTR_LONG_PREFIX_MASK);
> +
> + 		if (pf >= sbi->xattr_prefixes + sbi->xattr_prefix_count)
> + 			return 1;
> + 		infix = pf->prefix->infix;
> + 		infix_len = pf->infix_len;
> + 		base_index = pf->prefix->base_index;
> + 	}
>    
> - 	prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
>   -	h = erofs_xattr_handler(base_index);
>   -	if (!h || (h->list && !h->list(it->dentry)))
> ++	prefix = erofs_xattr_prefix(base_index, it->dentry);
>   +	if (!prefix)
>    		return 1;
>   -
>   -	prefix = xattr_prefix(h);
>    	prefix_len = strlen(prefix);
>    
>    	if (!it->buffer) {

Thanks,
Gao Xiang
  
Mark Brown April 13, 2023, 4:23 p.m. UTC | #3
On Fri, Apr 14, 2023 at 12:16:46AM +0800, Gao Xiang wrote:

> Thanks.  Actually I didn't update the corresponind xattr patches (just
> rebase some older commits, also I'd like to avoid in the future, but
> sometimes it's impossible at least if some RVB is added...)

> I think it could be resolved as before by Stephen:
> https://lore.kernel.org/r/20230412101942.75e3efa9@canb.auug.org.au

> And which looks the same as below:

Probably some context changed which caused me to have to reresolve the
conflict?  Or perhaps just rerere not syncing properly from Stephen's
work.
  
Gao Xiang April 13, 2023, 4:27 p.m. UTC | #4
On 2023/4/14 00:23, Mark Brown wrote:
> On Fri, Apr 14, 2023 at 12:16:46AM +0800, Gao Xiang wrote:
> 
>> Thanks.  Actually I didn't update the corresponind xattr patches (just
>> rebase some older commits, also I'd like to avoid in the future, but
>> sometimes it's impossible at least if some RVB is added...)
> 
>> I think it could be resolved as before by Stephen:
>> https://lore.kernel.org/r/20230412101942.75e3efa9@canb.auug.org.au
> 
>> And which looks the same as below:
> 
> Probably some context changed which caused me to have to reresolve the
> conflict?  Or perhaps just rerere not syncing properly from Stephen's
> work.

Not sure.. I didn't change the file itself.

Anyway, thanks for the efforts and time!

Thanks,
Gao Xiang
  
Christian Brauner April 20, 2023, 9:36 a.m. UTC | #5
On Thu, Apr 13, 2023 at 04:49:27PM +0100, Mark Brown wrote:
> On Thu, Apr 13, 2023 at 03:46:51PM +0100, broonie@kernel.org wrote:
> 
> > 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.
> 
> No, that's wrong.  This:

Yes, that fixup looks correct, thank you! 

> 
> diff --cc fs/erofs/xattr.c
> index 015462763bdd5,a04724c816e5f..0000000000000
> --- a/fs/erofs/xattr.c
> +++ b/fs/erofs/xattr.c
> @@@ -483,12 -517,28 +513,25 @@@ static int xattr_entrylist(struct xattr
>   {
>   	struct listxattr_iter *it =
>   		container_of(_it, struct listxattr_iter, it);
> - 	unsigned int prefix_len;
> - 	const char *prefix;
> + 	unsigned int base_index = entry->e_name_index;
> + 	unsigned int prefix_len, infix_len = 0;
> + 	const char *prefix, *infix = NULL;
>  -	const struct xattr_handler *h;
> + 
> + 	if (entry->e_name_index & EROFS_XATTR_LONG_PREFIX) {
> + 		struct erofs_sb_info *sbi = EROFS_SB(_it->sb);
> + 		struct erofs_xattr_prefix_item *pf = sbi->xattr_prefixes +
> + 			(entry->e_name_index & EROFS_XATTR_LONG_PREFIX_MASK);
> + 
> + 		if (pf >= sbi->xattr_prefixes + sbi->xattr_prefix_count)
> + 			return 1;
> + 		infix = pf->prefix->infix;
> + 		infix_len = pf->infix_len;
> + 		base_index = pf->prefix->base_index;
> + 	}
>   
> - 	prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
>  -	h = erofs_xattr_handler(base_index);
>  -	if (!h || (h->list && !h->list(it->dentry)))
> ++	prefix = erofs_xattr_prefix(base_index, it->dentry);
>  +	if (!prefix)
>   		return 1;
>  -
>  -	prefix = xattr_prefix(h);
>   	prefix_len = strlen(prefix);
>   
>   	if (!it->buffer) {
  

Patch

diff --cc fs/erofs/xattr.c
index 015462763bdd5,a04724c816e5f..0000000000000
--- a/fs/erofs/xattr.c