Re: [PATCH net-next v2 1/6] tcp: support writing to a socket in listening state

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

 



Hi Jeremy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on f685204c57e87d2a88b159c7525426d70ee745c9]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeremy-Harris/tcp-support-writing-to-a-socket-in-listening-state/20250521-195234
base:   f685204c57e87d2a88b159c7525426d70ee745c9
patch link:    https://lore.kernel.org/r/d3f47c9b5b08237b6e76f7b0739d59089683c86e.1747826775.git.jgh%40exim.org
patch subject: [PATCH net-next v2 1/6]     tcp: support writing to a socket in listening state
config: i386-buildonly-randconfig-001-20250522 (https://download.01.org/0day-ci/archive/20250522/202505221529.hEVx1YPV-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250522/202505221529.hEVx1YPV-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505221529.hEVx1YPV-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> net/ipv4/tcp.c:1065:23: warning: variable 'sockc' set but not used [-Wunused-but-set-variable]
    1065 |         struct sockcm_cookie sockc;
         |                              ^
   1 warning generated.


vim +/sockc +1065 net/ipv4/tcp.c

  1059	
  1060	/* Cut-down version of tcp_sendmsg_locked(), for writing on a listen socket
  1061	 */
  1062	static int tcp_sendmsg_preload(struct sock *sk, struct msghdr *msg)
  1063	{
  1064		struct sk_buff *skb;
> 1065		struct sockcm_cookie sockc;
  1066		int flags, err, copied = 0;
  1067		int size_goal;
  1068		int process_backlog = 0;
  1069		long timeo;
  1070	
  1071		if (sk->sk_state != TCP_LISTEN)
  1072			return -EINVAL;
  1073	
  1074		flags = msg->msg_flags;
  1075	
  1076		sockc = (struct sockcm_cookie){ .tsflags = READ_ONCE(sk->sk_tsflags) };
  1077	
  1078		timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
  1079	
  1080		/* Ok commence sending. */
  1081	restart:
  1082		/* Use a arbitrary "mss" value */
  1083		size_goal = 1000;
  1084	
  1085		err = -EPIPE;
  1086		if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
  1087			goto do_error;
  1088	
  1089		while (msg_data_left(msg)) {
  1090			ssize_t copy = 0;
  1091	
  1092			skb = tcp_write_queue_tail(sk);
  1093			if (skb)
  1094				copy = size_goal - skb->len;
  1095	
  1096			trace_tcp_sendmsg_locked(sk, msg, skb, size_goal);
  1097	
  1098			if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) {
  1099				bool first_skb = !skb;
  1100	
  1101				/* Limit to only one skb on the sk write queue */
  1102	
  1103				if (!first_skb)
  1104					goto out_nopush;
  1105	
  1106				if (!sk_stream_memory_free(sk))
  1107					goto wait_for_space;
  1108	
  1109				if (unlikely(process_backlog >= 16)) {
  1110					process_backlog = 0;
  1111					if (sk_flush_backlog(sk))
  1112						goto restart;
  1113				}
  1114	
  1115				skb = tcp_stream_alloc_skb(sk, sk->sk_allocation,
  1116							   first_skb);
  1117				if (!skb)
  1118					goto wait_for_space;
  1119	
  1120				process_backlog++;
  1121	

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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux