Skip to contentSkip to conversation

fs/smb/common/smbdirect/smbdirect_mr.c:288:33: warning: '%s' directive argument is null

PATCH kernel test robot 1 participant 1 message Feb 14

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://github.com/smfrench/smb3-kernel.git ksmbd-for-next
head:   5cf574b306a01ec7f3a507e999b524ee39f0dee0
commit: c333a45eeca9b8b3609714335e9f3f0a741fa55b [98/144] smb: client: make use of smbdirect.ko
config: arm64-randconfig-003-20260214 (https://download.01.org/0day-ci/archive/20260214/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260214/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from fs/smb/common/smbdirect/smbdirect_internal.h:26,
from fs/smb/common/smbdirect/smbdirect_mr.c:7:
fs/smb/common/smbdirect/smbdirect_mr.c: In function 'smbdirect_connection_mr_io_recovery_work':

>> fs/smb/common/smbdirect/smbdirect_mr.c:288:33: warning: '%s' directive argument is null [-Wformat-overflow=]
     288 |                                 "ib_alloc_mr failed ret=%d (%s) type=0x%x depth=%u\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:287:25: note: in expansion of macro 'smbdirect_log_rdma_mr'
     287 |                         smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |                         ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:288:61: note: format string is defined here
     288 |                                 "ib_alloc_mr failed ret=%d (%s) type=0x%x depth=%u\n",
         |                                                             ^~
   fs/smb/common/smbdirect/smbdirect_mr.c:276:33: warning: '%s' directive argument is null [-Wformat-overflow=]
     276 |                                 "ib_dereg_mr failed ret=%u (%s)\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:275:25: note: in expansion of macro 'smbdirect_log_rdma_mr'
     275 |                         smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |                         ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:276:61: note: format string is defined here
     276 |                                 "ib_dereg_mr failed ret=%u (%s)\n",
         |                                                             ^~
   fs/smb/common/smbdirect/smbdirect_mr.c: In function 'smbdirect_connection_get_mr_io':
   fs/smb/common/smbdirect/smbdirect_mr.c:187:25: warning: '%s' directive argument is null [-Wformat-overflow=]
     187 |                         "wait_event_interruptible ret=%d (%s)\n",
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:186:17: note: in expansion of macro 'smbdirect_log_rdma_mr'
     186 |                 smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |                 ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:187:59: note: format string is defined here
     187 |                         "wait_event_interruptible ret=%d (%s)\n",
         |                                                           ^~
   fs/smb/common/smbdirect/smbdirect_mr.c: In function 'smbdirect_connection_register_mr_io':
   fs/smb/common/smbdirect/smbdirect_mr.c:421:17: warning: '%s' directive argument is null [-Wformat-overflow=]
     421 |                 "ib_post_send failed ret=%d (%s) reg_wr->key=0x%x\n",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:420:9: note: in expansion of macro 'smbdirect_log_rdma_mr'
     420 |         smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |         ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:421:46: note: format string is defined here
     421 |                 "ib_post_send failed ret=%d (%s) reg_wr->key=0x%x\n",
         |                                              ^~
   fs/smb/common/smbdirect/smbdirect_mr.c:377:25: warning: '%s' directive argument is null [-Wformat-overflow=]
     377 |                         "ib_dma_map_sg num_pages=%u dir=%x ret=%d (%s)\n",
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:376:17: note: in expansion of macro 'smbdirect_log_rdma_mr'
     376 |                 smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |                 ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:377:68: note: format string is defined here
     377 |                         "ib_dma_map_sg num_pages=%u dir=%x ret=%d (%s)\n",
         |                                                                    ^~
   fs/smb/common/smbdirect/smbdirect_mr.c: In function 'smbdirect_connection_deregister_mr_io':
   fs/smb/common/smbdirect/smbdirect_mr.c:512:33: warning: '%s' directive argument is null [-Wformat-overflow=]
     512 |                                 "ib_post_send failed ret=%d (%s)\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
     552 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_MR, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:511:25: note: in expansion of macro 'smbdirect_log_rdma_mr'
     511 |                         smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
         |                         ^~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_mr.c:512:62: note: format string is defined here
     512 |                                 "ib_post_send failed ret=%d (%s)\n",
         |                                                              ^~
   fs/smb/common/smbdirect/smbdirect_mr.c: In function 'smbdirect_connection_create_mr_list':
   fs/smb/common/smbdirect/smbdirect_mr.c:49:33: warning: '%s' directive argument is null [-Wformat-overflow=]
      49 |                                 "ib_alloc_mr failed ret=%d (%s) type=0x%x max_frmr_depth=%u\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~

fs/smb/common/smbdirect/smbdirect_socket.h:552:17: note: in expansion of macro '__smbdirect_log_generic'
--
In file included from fs/smb/common/smbdirect/smbdirect_internal.h:26,
from fs/smb/common/smbdirect/smbdirect_connection.c:7:
fs/smb/common/smbdirect/smbdirect_connection.c: In function 'smbdirect_connection_post_recv_io':

>> fs/smb/common/smbdirect/smbdirect_connection.c:1516:25: warning: '%s' directive argument is null [-Wformat-overflow=]
    1516 |                         "ib_post_recv failed ret=%d (%s)\n",
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:546:17: note: in expansion of macro '__smbdirect_log_generic'
     546 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_RECV, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_connection.c:1515:17: note: in expansion of macro 'smbdirect_log_rdma_recv'
    1515 |                 smbdirect_log_rdma_recv(sc, SMBDIRECT_LOG_ERR,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_connection.c:1516:54: note: format string is defined here
    1516 |                         "ib_post_recv failed ret=%d (%s)\n",
         |                                                      ^~
   fs/smb/common/smbdirect/smbdirect_connection.c: In function 'smbdirect_connection_recv_io_refill':
   fs/smb/common/smbdirect/smbdirect_connection.c:1749:33: warning: '%s' directive argument is null [-Wformat-overflow=]
    1749 |                                 "smbdirect_connection_post_recv_io failed rc=%d (%s)\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_socket.h:529:66: note: in definition of macro '___smbdirect_log_generic'
     529 |                 __smbdirect_log_printf(sc, func, line, lvl, cls, fmt, ##args);  \
         |                                                                  ^~~
   fs/smb/common/smbdirect/smbdirect_socket.h:546:17: note: in expansion of macro '__smbdirect_log_generic'
     546 |                 __smbdirect_log_generic(sc, lvl, SMBDIRECT_LOG_RDMA_RECV, fmt, ##args)
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/common/smbdirect/smbdirect_connection.c:1748:25: note: in expansion of macro 'smbdirect_log_rdma_recv'
    1748 |                         smbdirect_log_rdma_recv(sc, SMBDIRECT_LOG_ERR,
         |                         ^~~~~~~~~~~~~~~~~~~~~~~

fs/smb/common/smbdirect/smbdirect_connection.c:1749:82: note: format string is defined here
1749 | "smbdirect_connection_post_recv_io failed rc=%d (%s)\n",
| ^~

vim +288 fs/smb/common/smbdirect/smbdirect_mr.c

1fed7d7a575b09 Stefan Metzmacher 2025-09-19  249  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  250  /*
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  251   * The work queue function that recovers MRs
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  252   * We need to call ib_dereg_mr() and ib_alloc_mr() before this MR can be used
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  253   * again. Both calls are slow, so finish them in a workqueue. This will not
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  254   * block I/O path.
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  255   * There is one workqueue that recovers MRs, there is no need to lock as the
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  256   * I/O requests calling smbd_register_mr will never update the links in the
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  257   * mr_list.
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  258   */
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  259  static void smbdirect_connection_mr_io_recovery_work(struct work_struct *work)
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  260  {
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  261  	struct smbdirect_socket *sc =
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  262  		container_of(work, struct smbdirect_socket, mr_io.recovery_work);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  263  	struct smbdirect_socket_parameters *sp = &sc->parameters;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  264  	struct smbdirect_mr_io *mr;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  265  	int ret;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  266  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  267  	list_for_each_entry(mr, &sc->mr_io.all.list, list) {
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  268  		if (mr->state != SMBDIRECT_MR_ERROR)
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  269  			/* This MR is being used, don't recover it */
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  270  			continue;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  271  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  272  		/* recover this MR entry */
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  273  		ret = ib_dereg_mr(mr->mr);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  274  		if (ret) {
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  275  			smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  276  				"ib_dereg_mr failed ret=%u (%s)\n",
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  277  				ret, errname(ret));
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  278  			smbdirect_socket_schedule_cleanup(sc, ret);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  279  			continue;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  280  		}
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  281  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  282  		mr->mr = ib_alloc_mr(sc->ib.pd,
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  283  				     sc->mr_io.type,
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  284  				     sp->max_frmr_depth);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  285  		if (IS_ERR(mr->mr)) {
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  286  			ret = PTR_ERR(mr->mr);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  287  			smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_ERR,
1fed7d7a575b09 Stefan Metzmacher 2025-09-19 @288  				"ib_alloc_mr failed ret=%d (%s) type=0x%x depth=%u\n",
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  289  				ret, errname(ret), sc->mr_io.type, sp->max_frmr_depth);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  290  			smbdirect_socket_schedule_cleanup(sc, ret);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  291  			continue;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  292  		}
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  293  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  294  		mr->state = SMBDIRECT_MR_READY;
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  295  
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  296  		/* smbdirect_mr->state is updated by this function
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  297  		 * and is read and updated by I/O issuing CPUs trying
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  298  		 * to get a MR, the call to atomic_inc_return
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  299  		 * implicates a memory barrier and guarantees this
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  300  		 * value is updated before waking up any calls to
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  301  		 * get_mr() from the I/O issuing CPUs
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  302  		 */
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  303  		if (atomic_inc_return(&sc->mr_io.ready.count) == 1)
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  304  			wake_up(&sc->mr_io.ready.wait_queue);
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  305  	}
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  306  }
1fed7d7a575b09 Stefan Metzmacher 2025-09-19  307  

:::::: The code at line 288 was first introduced by commit
:::::: 1fed7d7a575b0967f9600859934b925b2a11b564 smb: smbdirect: introduce smbdirect_mr.c with client mr code

:::::: TO: Stefan Metzmacher <[email protected]>
:::::: CC: Steve French <[email protected]>

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