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

From: Stephen Rothwell <[email-masked]>
Date: Thu, 6 Oct 2022 10:59:13 +1100

Hi all,

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

  fs/ksmbd/vfs.c

between commit:

  dbab80e2071a ("ksmbd: make utf-8 file name comparison work in __caseless_lookup()")

from the ksmbd tree and commit:

  25885a35a720 ("Change calling conventions for filldir_t")

from the vfs 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/ksmbd/vfs.c
index 8d8af724df70,48b2b901f6e5..000000000000
--- a/fs/ksmbd/vfs.c
+++ b/fs/ksmbd/vfs.c
@@@ -1150,23 -1149,13 +1148,23 @@@ static bool __caseless_lookup(struct di
  	buf = container_of(ctx, struct ksmbd_readdir_data, ctx);
  
  	if (buf->used != namlen)
- 		return 0;
+ 		return true;
 -	if (!strncasecmp((char *)buf->private, name, namlen)) {
 +	if (IS_ENABLED(CONFIG_UNICODE) && buf->um) {
 +		const struct qstr q_buf = {.name = buf->private,
 +					   .len = buf->used};
 +		const struct qstr q_name = {.name = name,
 +					    .len = namlen};
 +
 +		cmp = utf8_strncasecmp(buf->um, &q_buf, &q_name);
 +	}
 +	if (cmp < 0)
 +		cmp = strncasecmp((char *)buf->private, name, namlen);
 +	if (!cmp) {
  		memcpy((char *)buf->private, name, namlen);
  		buf->dirent_count = 1;
- 		return -EEXIST;
+ 		return false;
  	}
- 	return 0;
+ 	return true;
  }
  
  /**