All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android14-kiwi-6.1 550/550] fs/smb/client/connect.c:3004:20: sparse: sparse: incorrect type in assignment (different base types)
@ 2026-12-04  2:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-12-04  2:57 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android14-kiwi-6.1
head:   2dc8243e8005bf421458dfa77f5004eb833478a3
commit: 8e93857d8d5957136e070b2e1680c44bfafdd8dd [550/550] cifs: Fix establishing NetBIOS session for SMB2+ connection
config: i386-randconfig-2300-20261203 (https://download.01.org/0day-ci/archive/20261204/20261204035036.16L2Naor-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261204/20261204035036.16L2Naor-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261204035036.16L2Naor-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/smb/client/connect.c:3004:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] length @@     got restricted __be16 [usertype] @@
   fs/smb/client/connect.c:3004:20: sparse:     expected unsigned short [usertype] length
   fs/smb/client/connect.c:3004:20: sparse:     got restricted __be16 [usertype]

vim +3004 fs/smb/client/connect.c

  2958	
  2959	static int
  2960	ip_rfc1001_connect(struct TCP_Server_Info *server)
  2961	{
  2962		int rc = 0;
  2963		/*
  2964		 * some servers require RFC1001 sessinit before sending
  2965		 * negprot - BB check reconnection in case where second
  2966		 * sessinit is sent but no second negprot
  2967		 */
  2968		struct rfc1002_session_packet req = {};
  2969		struct msghdr msg = {};
  2970		struct kvec iov = {};
  2971		unsigned int len;
  2972		size_t sent;
  2973	
  2974		req.trailer.session_req.called_len = sizeof(req.trailer.session_req.called_name);
  2975	
  2976		if (server->server_RFC1001_name[0] != 0)
  2977			rfc1002mangle(req.trailer.session_req.called_name,
  2978				      server->server_RFC1001_name,
  2979				      RFC1001_NAME_LEN_WITH_NULL);
  2980		else
  2981			rfc1002mangle(req.trailer.session_req.called_name,
  2982				      DEFAULT_CIFS_CALLED_NAME,
  2983				      RFC1001_NAME_LEN_WITH_NULL);
  2984	
  2985		req.trailer.session_req.calling_len = sizeof(req.trailer.session_req.calling_name);
  2986	
  2987		/* calling name ends in null (byte 16) from old smb convention */
  2988		if (server->workstation_RFC1001_name[0] != 0)
  2989			rfc1002mangle(req.trailer.session_req.calling_name,
  2990				      server->workstation_RFC1001_name,
  2991				      RFC1001_NAME_LEN_WITH_NULL);
  2992		else
  2993			rfc1002mangle(req.trailer.session_req.calling_name,
  2994				      "LINUX_CIFS_CLNT",
  2995				      RFC1001_NAME_LEN_WITH_NULL);
  2996	
  2997		/*
  2998		 * As per rfc1002, @len must be the number of bytes that follows the
  2999		 * length field of a rfc1002 session request payload.
  3000		 */
  3001		len = sizeof(req.trailer.session_req);
  3002		req.type = RFC1002_SESSION_REQUEST;
  3003		req.flags = 0;
> 3004		req.length = cpu_to_be16(len);
  3005		len += offsetof(typeof(req), trailer.session_req);
  3006		iov.iov_base = &req;
  3007		iov.iov_len = len;
  3008		iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iov, 1, len);
  3009		rc = smb_send_kvec(server, &msg, &sent);
  3010		if (rc < 0 || len != sent)
  3011			return (rc == -EINTR || rc == -EAGAIN) ? rc : -ECONNABORTED;
  3012	
  3013		/*
  3014		 * RFC1001 layer in at least one server requires very short break before
  3015		 * negprot presumably because not expecting negprot to follow so fast.
  3016		 * This is a simple solution that works without complicating the code
  3017		 * and causes no significant slowing down on mount for everyone else
  3018		 */
  3019		usleep_range(1000, 2000);
  3020	
  3021		return 0;
  3022	}
  3023	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-04  2:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  2:57 [android-common:android14-kiwi-6.1 550/550] fs/smb/client/connect.c:3004:20: sparse: sparse: incorrect type in assignment (different base types) kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.