block/rnbd: use %pe to print errors
While printing error, replace %ld by %pe. %pe prints a string whereas %ld would print an error code. Signed-off-by: Supriti Singh <supriti.singh@ionos.com> Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@ionos.com> Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com> Link: https://lore.kernel.org/r/20231124213422.113449-3-haris.iqbal@ionos.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
fadf3dffe5
commit
70d85bec8f
@ -1569,8 +1569,8 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,
|
|||||||
|
|
||||||
dev = init_dev(sess, access_mode, pathname, nr_poll_queues);
|
dev = init_dev(sess, access_mode, pathname, nr_poll_queues);
|
||||||
if (IS_ERR(dev)) {
|
if (IS_ERR(dev)) {
|
||||||
pr_err("map_device: failed to map device '%s' from session %s, can't initialize device, err: %ld\n",
|
pr_err("map_device: failed to map device '%s' from session %s, can't initialize device, err: %pe\n",
|
||||||
pathname, sess->sessname, PTR_ERR(dev));
|
pathname, sess->sessname, dev);
|
||||||
ret = PTR_ERR(dev);
|
ret = PTR_ERR(dev);
|
||||||
goto put_sess;
|
goto put_sess;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +136,8 @@ static int process_rdma(struct rnbd_srv_session *srv_sess,
|
|||||||
|
|
||||||
sess_dev = rnbd_get_sess_dev(dev_id, srv_sess);
|
sess_dev = rnbd_get_sess_dev(dev_id, srv_sess);
|
||||||
if (IS_ERR(sess_dev)) {
|
if (IS_ERR(sess_dev)) {
|
||||||
pr_err_ratelimited("Got I/O request on session %s for unknown device id %d\n",
|
pr_err_ratelimited("Got I/O request on session %s for unknown device id %d: %pe\n",
|
||||||
srv_sess->sessname, dev_id);
|
srv_sess->sessname, dev_id, sess_dev);
|
||||||
err = -ENOTCONN;
|
err = -ENOTCONN;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@ -710,24 +710,24 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
|
|||||||
full_path = rnbd_srv_get_full_path(srv_sess, open_msg->dev_name);
|
full_path = rnbd_srv_get_full_path(srv_sess, open_msg->dev_name);
|
||||||
if (IS_ERR(full_path)) {
|
if (IS_ERR(full_path)) {
|
||||||
ret = PTR_ERR(full_path);
|
ret = PTR_ERR(full_path);
|
||||||
pr_err("Opening device '%s' for client %s failed, failed to get device full path, err: %d\n",
|
pr_err("Opening device '%s' for client %s failed, failed to get device full path, err: %pe\n",
|
||||||
open_msg->dev_name, srv_sess->sessname, ret);
|
open_msg->dev_name, srv_sess->sessname, full_path);
|
||||||
goto reject;
|
goto reject;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdev_handle = bdev_open_by_path(full_path, open_flags, NULL, NULL);
|
bdev_handle = bdev_open_by_path(full_path, open_flags, NULL, NULL);
|
||||||
if (IS_ERR(bdev_handle)) {
|
if (IS_ERR(bdev_handle)) {
|
||||||
ret = PTR_ERR(bdev_handle);
|
ret = PTR_ERR(bdev_handle);
|
||||||
pr_err("Opening device '%s' on session %s failed, failed to open the block device, err: %d\n",
|
pr_err("Opening device '%s' on session %s failed, failed to open the block device, err: %pe\n",
|
||||||
full_path, srv_sess->sessname, ret);
|
full_path, srv_sess->sessname, bdev_handle);
|
||||||
goto free_path;
|
goto free_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv_dev = rnbd_srv_get_or_create_srv_dev(bdev_handle->bdev, srv_sess,
|
srv_dev = rnbd_srv_get_or_create_srv_dev(bdev_handle->bdev, srv_sess,
|
||||||
open_msg->access_mode);
|
open_msg->access_mode);
|
||||||
if (IS_ERR(srv_dev)) {
|
if (IS_ERR(srv_dev)) {
|
||||||
pr_err("Opening device '%s' on session %s failed, creating srv_dev failed, err: %ld\n",
|
pr_err("Opening device '%s' on session %s failed, creating srv_dev failed, err: %pe\n",
|
||||||
full_path, srv_sess->sessname, PTR_ERR(srv_dev));
|
full_path, srv_sess->sessname, srv_dev);
|
||||||
ret = PTR_ERR(srv_dev);
|
ret = PTR_ERR(srv_dev);
|
||||||
goto blkdev_put;
|
goto blkdev_put;
|
||||||
}
|
}
|
||||||
@ -737,8 +737,8 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
|
|||||||
open_msg->access_mode == RNBD_ACCESS_RO,
|
open_msg->access_mode == RNBD_ACCESS_RO,
|
||||||
srv_dev);
|
srv_dev);
|
||||||
if (IS_ERR(srv_sess_dev)) {
|
if (IS_ERR(srv_sess_dev)) {
|
||||||
pr_err("Opening device '%s' on session %s failed, creating sess_dev failed, err: %ld\n",
|
pr_err("Opening device '%s' on session %s failed, creating sess_dev failed, err: %pe\n",
|
||||||
full_path, srv_sess->sessname, PTR_ERR(srv_sess_dev));
|
full_path, srv_sess->sessname, srv_sess_dev);
|
||||||
ret = PTR_ERR(srv_sess_dev);
|
ret = PTR_ERR(srv_sess_dev);
|
||||||
goto srv_dev_put;
|
goto srv_dev_put;
|
||||||
}
|
}
|
||||||
@ -819,7 +819,7 @@ static int __init rnbd_srv_init_module(void)
|
|||||||
};
|
};
|
||||||
rtrs_ctx = rtrs_srv_open(&rtrs_ops, port_nr);
|
rtrs_ctx = rtrs_srv_open(&rtrs_ops, port_nr);
|
||||||
if (IS_ERR(rtrs_ctx)) {
|
if (IS_ERR(rtrs_ctx)) {
|
||||||
pr_err("rtrs_srv_open(), err: %d\n", err);
|
pr_err("rtrs_srv_open(), err: %pe\n", rtrs_ctx);
|
||||||
return PTR_ERR(rtrs_ctx);
|
return PTR_ERR(rtrs_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user