[PATCH] cifs/cifs_debug: convert to list_for_each_entry()
kbuild test robot
lkp at intel.com
Sun Feb 23 10:51:43 UTC 2020
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on cifs/for-next]
[also build test ERROR on v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/qiwuchen55-gmail-com/cifs-cifs_debug-convert-to-list_for_each_entry/20200223-121120
base: git://git.samba.org/sfrench/cifs-2.6.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project 1df947ab403a9ec3bb1bf4cd83610a997dc4f3bc)
reproduce:
# FIXME the reproduce steps for clang is not ready yet
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
In file included from fs//cifs/cifs_debug.c:16:
In file included from fs//cifs/cifsglob.h:32:
fs//cifs/smb2pdu.h:28:10: error: 'cifsacl.h' file not found with <angled> include; use "quotes" instead
#include <cifsacl.h>
^~~~~~~~~~~
"cifsacl.h"
>> fs//cifs/cifs_debug.c:403:41: error: too many arguments provided to function-like macro invocation
list_for_each(tcon, &ses->tcon_list, tcon_list) {
^
include/linux/list.h:552:9: note: macro 'list_for_each' defined here
#define list_for_each(pos, head) \
^
>> fs//cifs/cifs_debug.c:403:4: error: use of undeclared identifier 'list_for_each'; did you mean 'idr_for_each'?
list_for_each(tcon, &ses->tcon_list, tcon_list) {
^~~~~~~~~~~~~
idr_for_each
include/linux/idr.h:120:5: note: 'idr_for_each' declared here
int idr_for_each(const struct idr *,
^
>> fs//cifs/cifs_debug.c:403:17: error: expected ';' after expression
list_for_each(tcon, &ses->tcon_list, tcon_list) {
^
;
fs//cifs/cifs_debug.c:403:4: warning: expression result unused [-Wunused-value]
list_for_each(tcon, &ses->tcon_list, tcon_list) {
^~~~~~~~~~~~~
1 warning and 4 errors generated.
vim +403 fs//cifs/cifs_debug.c
207
208 static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
209 {
210 struct mid_q_entry *mid_entry;
211 struct TCP_Server_Info *server;
212 struct cifs_ses *ses;
213 struct cifs_tcon *tcon;
214 int i, j;
215
216 seq_puts(m,
217 "Display Internal CIFS Data Structures for Debugging\n"
218 "---------------------------------------------------\n");
219 seq_printf(m, "CIFS Version %s\n", CIFS_VERSION);
220 seq_printf(m, "Features:");
221 #ifdef CONFIG_CIFS_DFS_UPCALL
222 seq_printf(m, " DFS");
223 #endif
224 #ifdef CONFIG_CIFS_FSCACHE
225 seq_printf(m, ",FSCACHE");
226 #endif
227 #ifdef CONFIG_CIFS_SMB_DIRECT
228 seq_printf(m, ",SMB_DIRECT");
229 #endif
230 #ifdef CONFIG_CIFS_STATS2
231 seq_printf(m, ",STATS2");
232 #else
233 seq_printf(m, ",STATS");
234 #endif
235 #ifdef CONFIG_CIFS_DEBUG2
236 seq_printf(m, ",DEBUG2");
237 #elif defined(CONFIG_CIFS_DEBUG)
238 seq_printf(m, ",DEBUG");
239 #endif
240 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
241 seq_printf(m, ",ALLOW_INSECURE_LEGACY");
242 #endif
243 #ifdef CONFIG_CIFS_WEAK_PW_HASH
244 seq_printf(m, ",WEAK_PW_HASH");
245 #endif
246 #ifdef CONFIG_CIFS_POSIX
247 seq_printf(m, ",CIFS_POSIX");
248 #endif
249 #ifdef CONFIG_CIFS_UPCALL
250 seq_printf(m, ",UPCALL(SPNEGO)");
251 #endif
252 #ifdef CONFIG_CIFS_XATTR
253 seq_printf(m, ",XATTR");
254 #endif
255 seq_printf(m, ",ACL");
256 seq_putc(m, '\n');
257 seq_printf(m, "CIFSMaxBufSize: %d\n", CIFSMaxBufSize);
258 seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);
259 seq_printf(m, "Servers:");
260
261 i = 0;
262 spin_lock(&cifs_tcp_ses_lock);
263 list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
264
265 #ifdef CONFIG_CIFS_SMB_DIRECT
266 if (!server->rdma)
267 goto skip_rdma;
268
269 if (!server->smbd_conn) {
270 seq_printf(m, "\nSMBDirect transport not available");
271 goto skip_rdma;
272 }
273
274 seq_printf(m, "\nSMBDirect (in hex) protocol version: %x "
275 "transport status: %x",
276 server->smbd_conn->protocol,
277 server->smbd_conn->transport_status);
278 seq_printf(m, "\nConn receive_credit_max: %x "
279 "send_credit_target: %x max_send_size: %x",
280 server->smbd_conn->receive_credit_max,
281 server->smbd_conn->send_credit_target,
282 server->smbd_conn->max_send_size);
283 seq_printf(m, "\nConn max_fragmented_recv_size: %x "
284 "max_fragmented_send_size: %x max_receive_size:%x",
285 server->smbd_conn->max_fragmented_recv_size,
286 server->smbd_conn->max_fragmented_send_size,
287 server->smbd_conn->max_receive_size);
288 seq_printf(m, "\nConn keep_alive_interval: %x "
289 "max_readwrite_size: %x rdma_readwrite_threshold: %x",
290 server->smbd_conn->keep_alive_interval,
291 server->smbd_conn->max_readwrite_size,
292 server->smbd_conn->rdma_readwrite_threshold);
293 seq_printf(m, "\nDebug count_get_receive_buffer: %x "
294 "count_put_receive_buffer: %x count_send_empty: %x",
295 server->smbd_conn->count_get_receive_buffer,
296 server->smbd_conn->count_put_receive_buffer,
297 server->smbd_conn->count_send_empty);
298 seq_printf(m, "\nRead Queue count_reassembly_queue: %x "
299 "count_enqueue_reassembly_queue: %x "
300 "count_dequeue_reassembly_queue: %x "
301 "fragment_reassembly_remaining: %x "
302 "reassembly_data_length: %x "
303 "reassembly_queue_length: %x",
304 server->smbd_conn->count_reassembly_queue,
305 server->smbd_conn->count_enqueue_reassembly_queue,
306 server->smbd_conn->count_dequeue_reassembly_queue,
307 server->smbd_conn->fragment_reassembly_remaining,
308 server->smbd_conn->reassembly_data_length,
309 server->smbd_conn->reassembly_queue_length);
310 seq_printf(m, "\nCurrent Credits send_credits: %x "
311 "receive_credits: %x receive_credit_target: %x",
312 atomic_read(&server->smbd_conn->send_credits),
313 atomic_read(&server->smbd_conn->receive_credits),
314 server->smbd_conn->receive_credit_target);
315 seq_printf(m, "\nPending send_pending: %x "
316 "send_payload_pending: %x",
317 atomic_read(&server->smbd_conn->send_pending),
318 atomic_read(&server->smbd_conn->send_payload_pending));
319 seq_printf(m, "\nReceive buffers count_receive_queue: %x "
320 "count_empty_packet_queue: %x",
321 server->smbd_conn->count_receive_queue,
322 server->smbd_conn->count_empty_packet_queue);
323 seq_printf(m, "\nMR responder_resources: %x "
324 "max_frmr_depth: %x mr_type: %x",
325 server->smbd_conn->responder_resources,
326 server->smbd_conn->max_frmr_depth,
327 server->smbd_conn->mr_type);
328 seq_printf(m, "\nMR mr_ready_count: %x mr_used_count: %x",
329 atomic_read(&server->smbd_conn->mr_ready_count),
330 atomic_read(&server->smbd_conn->mr_used_count));
331 skip_rdma:
332 #endif
333 seq_printf(m, "\nNumber of credits: %d Dialect 0x%x",
334 server->credits, server->dialect);
335 if (server->compress_algorithm == SMB3_COMPRESS_LZNT1)
336 seq_printf(m, " COMPRESS_LZNT1");
337 else if (server->compress_algorithm == SMB3_COMPRESS_LZ77)
338 seq_printf(m, " COMPRESS_LZ77");
339 else if (server->compress_algorithm == SMB3_COMPRESS_LZ77_HUFF)
340 seq_printf(m, " COMPRESS_LZ77_HUFF");
341 if (server->sign)
342 seq_printf(m, " signed");
343 if (server->posix_ext_supported)
344 seq_printf(m, " posix");
345
346 i++;
347 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
348 if ((ses->serverDomain == NULL) ||
349 (ses->serverOS == NULL) ||
350 (ses->serverNOS == NULL)) {
351 seq_printf(m, "\n%d) Name: %s Uses: %d Capability: 0x%x\tSession Status: %d ",
352 i, ses->serverName, ses->ses_count,
353 ses->capabilities, ses->status);
354 if (ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST)
355 seq_printf(m, "Guest\t");
356 else if (ses->session_flags & SMB2_SESSION_FLAG_IS_NULL)
357 seq_printf(m, "Anonymous\t");
358 } else {
359 seq_printf(m,
360 "\n%d) Name: %s Domain: %s Uses: %d OS:"
361 " %s\n\tNOS: %s\tCapability: 0x%x\n\tSMB"
362 " session status: %d ",
363 i, ses->serverName, ses->serverDomain,
364 ses->ses_count, ses->serverOS, ses->serverNOS,
365 ses->capabilities, ses->status);
366 }
367 if (server->rdma)
368 seq_printf(m, "RDMA\n\t");
369 seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To "
370 "Server: %d SecMode: 0x%x Req On Wire: %d",
371 server->tcpStatus,
372 server->reconnect_instance,
373 server->srv_count,
374 server->sec_mode, in_flight(server));
375
376 seq_printf(m, " In Send: %d In MaxReq Wait: %d",
377 atomic_read(&server->in_send),
378 atomic_read(&server->num_waiters));
379
380 /* dump session id helpful for use with network trace */
381 seq_printf(m, " SessionId: 0x%llx", ses->Suid);
382 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
383 seq_puts(m, " encrypted");
384 if (ses->sign)
385 seq_puts(m, " signed");
386
387 if (ses->chan_count > 1) {
388 seq_printf(m, "\n\n\tExtra Channels: %zu\n",
389 ses->chan_count-1);
390 for (j = 1; j < ses->chan_count; j++)
391 cifs_dump_channel(m, j, &ses->chans[j]);
392 }
393
394 seq_puts(m, "\n\tShares:");
395 j = 0;
396
397 seq_printf(m, "\n\t%d) IPC: ", j);
398 if (ses->tcon_ipc)
399 cifs_debug_tcon(m, ses->tcon_ipc);
400 else
401 seq_puts(m, "none\n");
402
> 403 list_for_each(tcon, &ses->tcon_list, tcon_list) {
404 ++j;
405 seq_printf(m, "\n\t%d) ", j);
406 cifs_debug_tcon(m, tcon);
407 }
408
409 seq_puts(m, "\n\tMIDs:\n");
410
411 spin_lock(&GlobalMid_Lock);
412 list_for_each_entry(mid_entry, &server->pending_mid_q,
413 qhead) {
414 seq_printf(m, "\tState: %d com: %d pid:"
415 " %d cbdata: %p mid %llu\n",
416 mid_entry->mid_state,
417 le16_to_cpu(mid_entry->command),
418 mid_entry->pid,
419 mid_entry->callback_data,
420 mid_entry->mid);
421 }
422 spin_unlock(&GlobalMid_Lock);
423
424 spin_lock(&ses->iface_lock);
425 if (ses->iface_count)
426 seq_printf(m, "\n\tServer interfaces: %zu\n",
427 ses->iface_count);
428 for (j = 0; j < ses->iface_count; j++) {
429 struct cifs_server_iface *iface;
430
431 iface = &ses->iface_list[j];
432 seq_printf(m, "\t%d)", j);
433 cifs_dump_iface(m, iface);
434 if (is_ses_using_iface(ses, iface))
435 seq_puts(m, "\t\t[CONNECTED]\n");
436 }
437 spin_unlock(&ses->iface_lock);
438 }
439 }
440 spin_unlock(&cifs_tcp_ses_lock);
441 seq_putc(m, '\n');
442
443 /* BB add code to dump additional info such as TCP session info now */
444 return 0;
445 }
446
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 72225 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20200223/053c61fb/config.gz>
More information about the samba-technical
mailing list