lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Jul 2023 10:00:26 +0200
From:   Christoph Hellwig <hch@....de>
To:     Nitesh Shetty <nj.shetty@...sung.com>
Cc:     Jens Axboe <axboe@...nel.dk>, Jonathan Corbet <corbet@....net>,
        Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...nel.org>, dm-devel@...hat.com,
        Keith Busch <kbusch@...nel.org>,
        Christoph Hellwig <hch@....de>,
        Sagi Grimberg <sagi@...mberg.me>,
        Chaitanya Kulkarni <kch@...dia.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>,
        martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
        willy@...radead.org, hare@...e.de, djwong@...nel.org,
        bvanassche@....org, ming.lei@...hat.com, dlemoal@...nel.org,
        nitheshshetty@...il.com, gost.dev@...sung.com,
        Kanchan Joshi <joshi.k@...sung.com>,
        Javier González <javier.gonz@...sung.com>,
        Anuj Gupta <anuj20.g@...sung.com>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-nvme@...ts.infradead.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v13 5/9] nvme: add copy offload support

> +	if (blk_rq_nr_phys_segments(req) != 2)
> +		return BLK_STS_IOERR;

The magic number of segments adding up source and dest really need
constants and helpers to make the code understandable.

> +	/* +1 shift as dst+src length is added in request merging, we send copy
> +	 * for half the length.
> +	 */
> +	n_lba = blk_rq_bytes(req) >> (ns->lba_shift + 1);

I do not understand the logic and comment here.

> +	if (WARN_ON(!n_lba))

WARN_ON_ONCE

> +		return BLK_STS_NOTSUPP;

and BLK_STS_NOTSUPP seems like the wrong error here, this is an
invalid argument.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ