[PATCH] nvmet-passthru: Cleanup nvmet_passthru_map_sg()

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Tue Oct 13 20:16:19 EDT 2020


On 10/9/20 16:18, Logan Gunthorpe wrote:
> Clean up some confusing elements of nvmet_passthru_map_sg() by returning
> early if the request is greater than the maximum bio size. This allows
> us to drop the sg_cnt variable.
>
> This should not result in any functional change but makes the code
> clearer and more understandable. The original code allocated a truncated
> bio then would return EINVAL when bio_add_pc_page() filled that bio. The
> new code just returns EINVAL early if this would happen.
>
> Fixes: c1fef73f793b ("nvmet: add passthru code to process commands")
> Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
> Suggested-by: Douglas Gilbert <dgilbert at interlog.com>
> Cc: Christoph Hellwig <hch at lst.de>
> Cc: Sagi Grimberg <sagi at grimberg.me>
> Cc: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>

why the prefix is nvmet-passthru ?




More information about the Linux-nvme mailing list