summaryrefslogtreecommitdiffstats
path: root/drivers/block/rnbd/rnbd-srv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rnbd/rnbd-srv.c')
-rw-r--r--drivers/block/rnbd/rnbd-srv.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index ab78eab97d..3a0d5dcec6 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -136,8 +136,8 @@ static int process_rdma(struct rnbd_srv_session *srv_sess,
sess_dev = rnbd_get_sess_dev(dev_id, srv_sess);
if (IS_ERR(sess_dev)) {
- pr_err_ratelimited("Got I/O request on session %s for unknown device id %d\n",
- srv_sess->sessname, dev_id);
+ pr_err_ratelimited("Got I/O request on session %s for unknown device id %d: %pe\n",
+ srv_sess->sessname, dev_id, sess_dev);
err = -ENOTCONN;
goto err;
}
@@ -544,7 +544,8 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->max_segments = cpu_to_le16(bdev_max_segments(bdev));
rsp->max_hw_sectors =
cpu_to_le32(queue_max_hw_sectors(bdev_get_queue(bdev)));
- rsp->max_write_same_sectors = 0;
+ rsp->max_write_zeroes_sectors =
+ cpu_to_le32(bdev_write_zeroes_sectors(bdev));
rsp->max_discard_sectors = cpu_to_le32(bdev_max_discard_sectors(bdev));
rsp->discard_granularity = cpu_to_le32(bdev_discard_granularity(bdev));
rsp->discard_alignment = cpu_to_le32(bdev_discard_alignment(bdev));
@@ -710,24 +711,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);
if (IS_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",
- open_msg->dev_name, srv_sess->sessname, ret);
+ 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, full_path);
goto reject;
}
bdev_handle = bdev_open_by_path(full_path, open_flags, NULL, NULL);
if (IS_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",
- full_path, srv_sess->sessname, ret);
+ pr_err("Opening device '%s' on session %s failed, failed to open the block device, err: %pe\n",
+ full_path, srv_sess->sessname, bdev_handle);
goto free_path;
}
srv_dev = rnbd_srv_get_or_create_srv_dev(bdev_handle->bdev, srv_sess,
open_msg->access_mode);
if (IS_ERR(srv_dev)) {
- pr_err("Opening device '%s' on session %s failed, creating srv_dev failed, err: %ld\n",
- full_path, srv_sess->sessname, PTR_ERR(srv_dev));
+ pr_err("Opening device '%s' on session %s failed, creating srv_dev failed, err: %pe\n",
+ full_path, srv_sess->sessname, srv_dev);
ret = PTR_ERR(srv_dev);
goto blkdev_put;
}
@@ -737,8 +738,8 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
open_msg->access_mode == RNBD_ACCESS_RO,
srv_dev);
if (IS_ERR(srv_sess_dev)) {
- pr_err("Opening device '%s' on session %s failed, creating sess_dev failed, err: %ld\n",
- full_path, srv_sess->sessname, PTR_ERR(srv_sess_dev));
+ pr_err("Opening device '%s' on session %s failed, creating sess_dev failed, err: %pe\n",
+ full_path, srv_sess->sessname, srv_sess_dev);
ret = PTR_ERR(srv_sess_dev);
goto srv_dev_put;
}
@@ -819,7 +820,7 @@ static int __init rnbd_srv_init_module(void)
};
rtrs_ctx = rtrs_srv_open(&rtrs_ops, port_nr);
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);
}