linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"agk@redhat.com" <agk@redhat.com>,
	"song@kernel.org" <song@kernel.org>,
	"djwong@kernel.org" <djwong@kernel.org>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	"hch@lst.de" <hch@lst.de>, "sagi@grimberg.me" <sagi@grimberg.me>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"javier@javigon.com" <javier@javigon.com>,
	"johannes.thumshirn@wdc.com" <johannes.thumshirn@wdc.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"dongli.zhang@oracle.com" <dongli.zhang@oracle.com>,
	"ming.lei@redhat.com" <ming.lei@redhat.com>,
	"jefflexu@linux.alibaba.com" <jefflexu@linux.alibaba.com>,
	"josef@toxicpanda.com" <josef@toxicpanda.com>,
	"clm@fb.com" <clm@fb.com>, "dsterba@suse.com" <dsterba@suse.com>,
	"jack@suse.com" <jack@suse.com>, "tytso@mit.edu" <tytso@mit.edu>,
	"adilger.kernel@dilger.ca" <adilger.kernel@dilger.ca>,
	"jlayton@kernel.org" <jlayton@kernel.org>,
	"idryomov@gmail.com" <idryomov@gmail.com>,
	"danil.kipnis@cloud.ionos.com" <danil.kipnis@cloud.ionos.com>,
	"ebiggers@google.com" <ebiggers@google.com>,
	"jinpu.wang@cloud.ionos.com" <jinpu.wang@cloud.ionos.com>
Subject: Re: [PATCH 0/6] block: add support for REQ_OP_VERIFY
Date: Wed, 13 Jul 2022 13:17:56 +0100	[thread overview]
Message-ID: <Ys639LsjBUGPNErd@casper.infradead.org> (raw)
In-Reply-To: <5ffe57d3-354c-eabe-ea38-9c4201c13970@nvidia.com>

On Wed, Jul 13, 2022 at 09:14:42AM +0000, Chaitanya Kulkarni wrote:
> On 7/6/22 10:42, Matthew Wilcox wrote:
> > On Thu, Jun 30, 2022 at 02:14:00AM -0700, Chaitanya Kulkarni wrote:
> >> This adds support for the REQ_OP_VERIFY. In this version we add
> > 
> > IMO, VERIFY is a useless command.  The history of storage is full of
> > devices which simply lie.  Since there's no way for the host to check if
> > the device did any work, cheap devices may simply implement it as a NOOP.
> 
> Thanks for sharing your feedback regarding cheap devices.
> 
> This falls outside of the scope of the work, as scope of this work is
> not to analyze different vendor implementations of the verify command.

The work is pointless.  As a customer, I can't ever use the VERIFY
command because I have no reason for trusting the outcome.  And there's
no way for a vendor to convince me that I should trust the result.

> > Even expensive devices where there's an ironclad legal contract between
> > the vendor and customer may have bugs that result in only some of the
> > bytes being VERIFYed.  We shouldn't support it.
> This is not true with enterprise SSDs, I've been involved with product
> qualification of the high end enterprise SSDs since 2012 including good
> old non-nvme devices with e.g. skd driver on linux/windows/vmware.

Oh, I'm sure there's good faith at the high end.  But bugs happen in
firmware, and everybody knows it.

> > Now, everything you say about its value (not consuming bus bandwidth)
> > is true, but the device should provide the host with proof-of-work.
> 
> Yes that seems to be missing but it is not a blocker in this work since
> protocol needs to provide this information.

There's no point in providing access to a feature when that feature is
not useful.

> We can update the respective specification to add a log page which
> shows proof of work for verify command e.g.
> A log page consist of the information such as :-
> 
> 1. How many LBAs were verified ? How long it took.
> 2. What kind of errors were detected ?
> 3. How many blocks were moved to safe location ?
> 4. How much data (LBAs) been moved successfully ?
> 5. How much data we lost permanently with uncorrectible errors?
> 6. What is the impact on the overall size of the storage, in
>     case of flash reduction in the over provisioning due to
>     uncorrectible errors.

That's not proof of work.  That's claim of work.

> > I'd suggest calculating some kind of checksum, even something like a
> > SHA-1 of the contents would be worth having.  It doesn't need to be
> > crypto-secure; just something the host can verify the device didn't spoof.
> 
> I did not understand exactly what you mean here.

The firmware needs to prove to me that it *did something*.  That it
actually read those bytes that it claims to have verified.  The simplest
way to do so is to calculate a hash over the blocks which were read
(maybe the host needs to provide a nonce as part of the VERIFY command
so the drive can't "remember" the checksum).

  parent reply	other threads:[~2022-07-13 12:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30  9:14 [PATCH 0/6] block: add support for REQ_OP_VERIFY Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 1/6] " Chaitanya Kulkarni
2022-06-30 16:18   ` Darrick J. Wong
2022-07-05 16:50     ` Chaitanya Kulkarni
2022-07-05 17:57       ` Darrick J. Wong
2022-07-06  1:32         ` Chaitanya Kulkarni
2022-07-05  8:34   ` Christoph Hellwig
2022-07-05 23:55     ` Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 2/6] nvme: add support for the Verify command Chaitanya Kulkarni
2022-06-30 16:24   ` Keith Busch
2022-07-05  8:34     ` Christoph Hellwig
2022-07-05 23:56       ` Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 3/6] nvmet: add Verify command support for bdev-ns Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 4/6] nvmet: add Verify emulation " Chaitanya Kulkarni
2022-07-05  8:35   ` Christoph Hellwig
2022-07-06  0:00     ` Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 5/6] nvmet: add verify emulation support for file-ns Chaitanya Kulkarni
2022-07-05  8:36   ` Christoph Hellwig
2022-07-06  0:06     ` Chaitanya Kulkarni
2022-06-30  9:14 ` [PATCH 6/6] null_blk: add REQ_OP_VERIFY support Chaitanya Kulkarni
2022-07-05  8:38 ` [PATCH 0/6] block: add support for REQ_OP_VERIFY Christoph Hellwig
2022-07-05 16:47   ` Chaitanya Kulkarni
2022-07-06 17:42 ` Matthew Wilcox
2022-07-13  9:14   ` Chaitanya Kulkarni
2022-07-13  9:36     ` Johannes Thumshirn
2022-07-13 12:17     ` Matthew Wilcox [this message]
2022-07-13 14:04       ` Keith Busch
2022-12-01 18:12   ` Chaitanya Kulkarni
2022-12-01 19:39     ` Matthew Wilcox
2022-12-02  7:16       ` Hannes Reinecke
2022-12-02 14:58         ` Keith Busch
2022-12-02 17:33           ` Clay Mayers
2022-12-02 18:58             ` Keith Busch
2022-12-09  4:52             ` Martin K. Petersen
2022-12-10 13:06               ` Carlos Carvalho
2022-12-12  6:30                 ` hch
2022-12-03  4:19           ` Javier González
2022-12-04 20:29             ` Keith Busch
2022-12-08 20:06               ` Javier González
2022-12-08 20:02             ` Matthew Wilcox
2022-12-02  7:13     ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ys639LsjBUGPNErd@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=chaitanyak@nvidia.com \
    --cc=clm@fb.com \
    --cc=danil.kipnis@cloud.ionos.com \
    --cc=djwong@kernel.org \
    --cc=dongli.zhang@oracle.com \
    --cc=dsterba@suse.com \
    --cc=ebiggers@google.com \
    --cc=hch@lst.de \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.com \
    --cc=javier@javigon.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=jlayton@kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=song@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).