@@ -400,7 +400,8 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
{
char *stream_buf = NULL, *wbuf;
struct mnt_idmap *idmap = file_mnt_idmap(fp->filp);
- size_t size, v_len;
+ size_t size;
+ ssize_t v_len;
int err = 0;
ksmbd_debug(VFS, "write stream data pos : %llu, count : %zd\n",
@@ -417,9 +418,9 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
fp->stream.name,
fp->stream.size,
&stream_buf);
- if ((int)v_len < 0) {
+ if (v_len < 0) {
pr_err("not found stream in xattr : %zd\n", v_len);
- err = (int)v_len;
+ err = v_len;
goto out;
}
The return value of the ksmbd_vfs_getcasexattr() is long. However, the return value is being assigned to an unsignef long variable 'v_len',so making 'v_len' to long. silence the warning: ./fs/smb/server/vfs.c:WARNING: Unsigned expression compared with zero: v_len > 0 Signed-off-by: Wang Ming <machel@vivo.com> Fixes: 53ab6975c12d ("Add linux-next specific files for 20230609") --- This version adds 'Fixes:tag' compared to previous versions. fs/smb/server/vfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.25.1