<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/rnbd, branch v6.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-08-02T23:14:50Z</updated>
<entry>
<title>block/rnbd-srv: Replace sess_dev_list with index_idr</title>
<updated>2022-08-02T23:14:50Z</updated>
<author>
<name>Md Haris Iqbal</name>
<email>haris.iqbal@ionos.com</email>
</author>
<published>2022-07-07T14:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce11bdf946176d48c2c0d36b56f0bf368c177298'/>
<id>urn:sha1:ce11bdf946176d48c2c0d36b56f0bf368c177298</id>
<content type='text'>
The structure rnbd_srv_session maintains a list and an xarray of
rnbd_srv_dev. There is no need to keep both as one of them can serve the
purpose.

Since one of the places where the lookup of rnbd_srv_dev using
rnbd_srv_session is IO path, an xarray would serve us better than a list
traversal. Hence remove sess_dev_list from rnbd_srv_session, and replace
its uses from xarray.

Signed-off-by: Md Haris Iqbal &lt;haris.iqbal@ionos.com&gt;
Reviewed-by: Aleksei Marov &lt;aleksei.marov@ionos.com&gt;
Signed-off-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Link: https://lore.kernel.org/r/20220707143122.460362-3-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block/rnbd-srv: Set keep_id to true after mutex_trylock</title>
<updated>2022-08-02T23:14:50Z</updated>
<author>
<name>Md Haris Iqbal</name>
<email>haris.iqbal@ionos.com</email>
</author>
<published>2022-07-07T14:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4bc14f3101364877dd59085f39e068a2a7ec9f2d'/>
<id>urn:sha1:4bc14f3101364877dd59085f39e068a2a7ec9f2d</id>
<content type='text'>
After setting keep_id if the mutex trylock fails, the keep_id stays set
for the rest of the sess_dev lifetime.

Therefore, set keep_id to true after mutex_trylock succeeds, so that a
failure of trylock does'nt touch keep_id.

Fixes: b168e1d85cf3 ("block/rnbd-srv: Prevent a deadlock generated by accessing sysfs in parallel")
Cc: gi-oh.kim@ionos.com
Signed-off-by: Md Haris Iqbal &lt;haris.iqbal@ionos.com&gt;
Signed-off-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Link: https://lore.kernel.org/r/20220707143122.460362-2-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: make rnbd_clt_change_capacity return void</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e507210a06282a0ebaa84e8c9b4d8ad597b24a8b'/>
<id>urn:sha1:e507210a06282a0ebaa84e8c9b4d8ad597b24a8b</id>
<content type='text'>
No need to checking the return value, make it return void.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-9-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: pass sector_t type for resize capacity</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ae2dfd1d8d253d7c11bbe624f0ac997db5143147'/>
<id>urn:sha1:ae2dfd1d8d253d7c11bbe624f0ac997db5143147</id>
<content type='text'>
Let's change the parameter type to 'sector_t' then we don't need to cast
it from rnbd_clt_resize_dev_store, and update rnbd_clt_resize_disk too.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-8-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: check capacity inside rnbd_clt_change_capacity</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb516fa367a3554f3b71a0b37a52716cc358ea65'/>
<id>urn:sha1:fb516fa367a3554f3b71a0b37a52716cc358ea65</id>
<content type='text'>
Currently, process_msg_open_rsp checks if capacity changed or not before
call rnbd_clt_change_capacity while the checking also make sense for
rnbd_clt_resize_dev_store, let's move the checking into the function.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-7-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: adjust the layout of struct rnbd_clt_dev</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59f070de125f568fb7ba47b6555b4013e30f28fd'/>
<id>urn:sha1:59f070de125f568fb7ba47b6555b4013e30f28fd</id>
<content type='text'>
While at it, let re-arrange the struct to remove holes.

Before, pahole reports

	/* size: 232, cachelines: 4, members: 17 */
	/* sum members: 224, holes: 2, sum holes: 8 */
	/* last cacheline: 40 bytes */

After the change, the report changes to

	/* size: 224, cachelines: 4, members: 17 */
	/* last cacheline: 32 bytes */

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-6-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: reduce the size of struct rnbd_clt_dev</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dfc270c908e81f586c1165acbd9bc5c6d18c3fc0'/>
<id>urn:sha1:dfc270c908e81f586c1165acbd9bc5c6d18c3fc0</id>
<content type='text'>
Previously, both map and remap trigger rnbd_clt_set_dev_attr to set
some members in rnbd_clt_dev such as wc, fua and logical_block_size
etc, but those members are only useful for map scenario given the
setup_request_queue is only called from the path:

rnbd_clt_map_device -&gt; rnbd_client_setup_device

Since rnbd_clt_map_device frees rsp after rnbd_client_setup_device,
we can pass rsp to rnbd_client_setup_device and it's callees, which
means queue's attributes can be set directly from relevant members
of rsp instead from rnbd_clt_dev.

After that, we can kill 11 members from rnbd_clt_dev, and we don't
need rnbd_clt_set_dev_attr either.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-5-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: kill read_only from struct rnbd_clt_dev</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=017d76f45e81bd1b741e16c5fed6baeb80460dff'/>
<id>urn:sha1:017d76f45e81bd1b741e16c5fed6baeb80460dff</id>
<content type='text'>
The member is not needed since we can call get_disk_ro to achieve the
same goal.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-4-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: don't free rsp in msg_open_conf for map scenario</title>
<updated>2022-08-02T23:14:45Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52334f4a573d8a91ebe1581bac5fa8027df59221'/>
<id>urn:sha1:52334f4a573d8a91ebe1581bac5fa8027df59221</id>
<content type='text'>
For map scenario, rsp is freed in two places:

1. msg_open_conf frees rsp if rtrs_clt_request returns 0.

2. Otherwise, rsp is freed by the call sites of rtrs_clt_request.

Now, We'd like to control full lifecycle of rsp in rnbd_clt_map_device,
with that, it is feasible to pass rsp to rnbd_client_setup_device in
next commit.

For 1, it is possible to free rsp from the caller of send_usr_msg
because of the synchronization of iu-&gt;comp.wait. And we put iu later
in rnbd_clt_map_device to ensure order of release rsp and iu.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-3-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>rnbd-clt: open code send_msg_open in rnbd_clt_map_device</title>
<updated>2022-08-02T23:14:44Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@linux.dev</email>
</author>
<published>2022-07-06T13:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ddae3bab6d7bc769c7ca94ba010f33bc3f1aa8c'/>
<id>urn:sha1:9ddae3bab6d7bc769c7ca94ba010f33bc3f1aa8c</id>
<content type='text'>
Let's open code it in rnbd_clt_map_device, then we can use information
from rsp to setup gendisk and request_queue in next commits. After that,
we can remove some members (wc, fua and max_hw_sectors etc) from struct
rnbd_clt_dev.

Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Link: https://lore.kernel.org/r/20220706133152.12058-2-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
