@@ -136,8 +136,8 @@ static int process_rdma(struct rnbd_srv_session *srv_sess,
136136
137137 sess_dev = rnbd_get_sess_dev (dev_id , srv_sess );
138138 if (IS_ERR (sess_dev )) {
139- pr_err_ratelimited ("Got I/O request on session %s for unknown device id %d\n" ,
140- srv_sess -> sessname , dev_id );
139+ pr_err_ratelimited ("Got I/O request on session %s for unknown device id %d: %pe \n" ,
140+ srv_sess -> sessname , dev_id , sess_dev );
141141 err = - ENOTCONN ;
142142 goto err ;
143143 }
@@ -710,24 +710,24 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
710710 full_path = rnbd_srv_get_full_path (srv_sess , open_msg -> dev_name );
711711 if (IS_ERR (full_path )) {
712712 ret = PTR_ERR (full_path );
713- pr_err ("Opening device '%s' for client %s failed, failed to get device full path, err: %d \n" ,
714- open_msg -> dev_name , srv_sess -> sessname , ret );
713+ pr_err ("Opening device '%s' for client %s failed, failed to get device full path, err: %pe \n" ,
714+ open_msg -> dev_name , srv_sess -> sessname , full_path );
715715 goto reject ;
716716 }
717717
718718 bdev_handle = bdev_open_by_path (full_path , open_flags , NULL , NULL );
719719 if (IS_ERR (bdev_handle )) {
720720 ret = PTR_ERR (bdev_handle );
721- pr_err ("Opening device '%s' on session %s failed, failed to open the block device, err: %d \n" ,
722- full_path , srv_sess -> sessname , ret );
721+ pr_err ("Opening device '%s' on session %s failed, failed to open the block device, err: %pe \n" ,
722+ full_path , srv_sess -> sessname , bdev_handle );
723723 goto free_path ;
724724 }
725725
726726 srv_dev = rnbd_srv_get_or_create_srv_dev (bdev_handle -> bdev , srv_sess ,
727727 open_msg -> access_mode );
728728 if (IS_ERR (srv_dev )) {
729- pr_err ("Opening device '%s' on session %s failed, creating srv_dev failed, err: %ld \n" ,
730- full_path , srv_sess -> sessname , PTR_ERR ( srv_dev ) );
729+ pr_err ("Opening device '%s' on session %s failed, creating srv_dev failed, err: %pe \n" ,
730+ full_path , srv_sess -> sessname , srv_dev );
731731 ret = PTR_ERR (srv_dev );
732732 goto blkdev_put ;
733733 }
@@ -737,8 +737,8 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
737737 open_msg -> access_mode == RNBD_ACCESS_RO ,
738738 srv_dev );
739739 if (IS_ERR (srv_sess_dev )) {
740- pr_err ("Opening device '%s' on session %s failed, creating sess_dev failed, err: %ld \n" ,
741- full_path , srv_sess -> sessname , PTR_ERR ( srv_sess_dev ) );
740+ pr_err ("Opening device '%s' on session %s failed, creating sess_dev failed, err: %pe \n" ,
741+ full_path , srv_sess -> sessname , srv_sess_dev );
742742 ret = PTR_ERR (srv_sess_dev );
743743 goto srv_dev_put ;
744744 }
@@ -819,7 +819,7 @@ static int __init rnbd_srv_init_module(void)
819819 };
820820 rtrs_ctx = rtrs_srv_open (& rtrs_ops , port_nr );
821821 if (IS_ERR (rtrs_ctx )) {
822- pr_err ("rtrs_srv_open(), err: %d \n" , err );
822+ pr_err ("rtrs_srv_open(), err: %pe \n" , rtrs_ctx );
823823 return PTR_ERR (rtrs_ctx );
824824 }
825825
0 commit comments