Patch "ksmbd: fix warning: comparison of distinct pointer types lacks a cast" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ksmbd: fix warning: comparison of distinct pointer types lacks a cast

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ksmbd-fix-warning-comparison-of-distinct-pointer-typ.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9ce178c2a01a06a66dd2d1a0cc9a379c64f63ea8
Author: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Date:   Thu Sep 19 09:22:57 2024 +0900

    ksmbd: fix warning: comparison of distinct pointer types lacks a cast
    
    [ Upstream commit 289ebd9afeb94862d96c89217068943f1937df5b ]
    
    smb2pdu.c: In function ‘smb2_open’:
    ./include/linux/minmax.h:20:28: warning: comparison of distinct
    pointer types lacks a cast
       20 |  (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
          |                            ^~
    ./include/linux/minmax.h:26:4: note: in expansion of macro ‘__typecheck’
       26 |   (__typecheck(x, y) && __no_side_effects(x, y))
          |    ^~~~~~~~~~~
    ./include/linux/minmax.h:36:24: note: in expansion of macro ‘__safe_cmp’
       36 |  __builtin_choose_expr(__safe_cmp(x, y), \
          |                        ^~~~~~~~~~
    ./include/linux/minmax.h:45:19: note: in expansion of macro ‘__careful_cmp’
       45 | #define min(x, y) __careful_cmp(x, y, <)
          |                   ^~~~~~~~~~~~~
    /home/linkinjeon/git/smbd_work/ksmbd/smb2pdu.c:3713:27: note: in
    expansion of macro ‘min’
     3713 |     fp->durable_timeout = min(dh_info.timeout,
    
    Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
    Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 8bdc592514188..065adfb985fe2 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3531,8 +3531,9 @@ int smb2_open(struct ksmbd_work *work)
 			memcpy(fp->create_guid, dh_info.CreateGuid,
 					SMB2_CREATE_GUID_SIZE);
 			if (dh_info.timeout)
-				fp->durable_timeout = min(dh_info.timeout,
-						DURABLE_HANDLE_MAX_TIMEOUT);
+				fp->durable_timeout =
+					min_t(unsigned int, dh_info.timeout,
+					      DURABLE_HANDLE_MAX_TIMEOUT);
 			else
 				fp->durable_timeout = 60;
 		}
diff --git a/fs/smb/server/vfs_cache.h b/fs/smb/server/vfs_cache.h
index b0f6d0f94cb8d..5bbb179736c29 100644
--- a/fs/smb/server/vfs_cache.h
+++ b/fs/smb/server/vfs_cache.h
@@ -100,8 +100,8 @@ struct ksmbd_file {
 	struct list_head		blocked_works;
 	struct list_head		lock_list;
 
-	int				durable_timeout;
-	int				durable_scavenger_timeout;
+	unsigned int			durable_timeout;
+	unsigned int			durable_scavenger_timeout;
 
 	/* if ls is happening on directory, below is valid*/
 	struct ksmbd_readdir_data	readdir_data;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux