block/rnbd-srv: Add sanity check and remove redundant assignment
authorMd Haris Iqbal <haris.iqbal@ionos.com>
Fri, 9 Aug 2024 13:53:46 +0000 (15:53 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 28 Aug 2024 14:50:35 +0000 (08:50 -0600)
commitf6f84be089c9d6f5e3e1228c389e51c7ae7bad1a
tree7988a994ed91a8f707ff0d8bd9e8c99242fdcdd6
parent752a59298ea9c695ec966fc5ba7173897a1ef361
block/rnbd-srv: Add sanity check and remove redundant assignment

The bio->bi_iter.bi_size is updated when bio_add_page() is called. So we
do not need to assign msg->bi_size again to it, since its redudant and
can also be harmful. Instead we can use it to add a sanity check, which
checks the locally calculated bi_size, with the one sent in msg.

Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@ionos.com>
Link: https://lore.kernel.org/r/20240809135346.978320-1-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-srv.c