fs:smb:Fix unsigned expression compared with zero
Subsystems (2)
PATCH 1/1 fs:smb:Fix unsigned expression compared with zero
The return value of the ksmbd_vfs_getcasexattr() is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type.
--- fs/smb/server/vfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/smb/server/vfs.c +4 -3
@@ -412,7 +412,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",
@@ -429,9 +430,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; }
Signature · 1 line
2.25.1
2023-07-04 16:40 GMT+09:00, Wang Ming <[email protected]>:
Quoted 6 lines
The return value of the
ksmbd_vfs_getcasexattr()is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type.Signed-off-by Wang Ming <[email protected]>
Thanks for your patch!
Tom Talpey
reviewerQuoted 11 lines · Namjae Jeon
2023-07-04 16:40 GMT+09:00, Wang Ming <[email protected]>:
Quoted 6 lines
The return value of the
ksmbd_vfs_getcasexattr()is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type.Signed-off-by Wang Ming <[email protected]>Acked-by Namjae Jeon <[email protected]>Thanks for your patch!
FYI, this is missing my previous Acked-by. The updated changelog otherwise looks good.
Tom.
2023-07-04 22:58 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 7 lines · Namjae Jeon
Quoted 6 lines
2023-07-04 16:40 GMT+09:00, Wang Ming <[email protected]>:
Quoted 5 lines
The return value of the
ksmbd_vfs_getcasexattr()is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Wang Ming <[email protected]>Acked-by Namjae Jeon <[email protected]>Thanks for your patch!
FYI, this is missing my previous Acked-by. The updated changelog otherwise looks good.
Applied it with your acked-by tag to #ksmbd-for-next-next.
Thanks!
Quoted 3 lines
Tom.