All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Bryan Gurney <bgurney@redhat.com>
Cc: John Dorminy <jdorminy@redhat.com>,
	Joe Shimkus <jshimkus@redhat.com>,
	dm-devel@redhat.com, tjaskiew@redhat.com,
	John Pittman <jpittman@redhat.com>,
	Alasdair G Kergon <agk@redhat.com>
Subject: Re: [RFC PATCH 1/1] dm: add dust target
Date: Tue, 8 Jan 2019 15:29:20 -0500	[thread overview]
Message-ID: <20190108202920.GA22316@redhat.com> (raw)
In-Reply-To: <CAHhmqcTfKniu1eP+fBwHf4gohOfUaz_cgaC3EUezNauUAk6O-Q@mail.gmail.com>

On Tue, Jan 08 2019 at  2:52pm -0500,
Bryan Gurney <bgurney@redhat.com> wrote:

> On Tue, Jan 8, 2019 at 11:23 AM Mike Snitzer <snitzer@redhat.com> wrote:
> >
> > I'm fine with it as is, but I have a different concern: why does this
> > target need to override the queue_limits at all?  What is the benefit to
> > rigidly imposing the provided 512 or 4096 bytes for all of
> > {logical_block,physical_block,minimum_io,optimal_io}_size?
> >
> 
> This is a bit of a complex question, which may cover multiple areas.
> I unfortunately don't have as much expertise in the "backend" of the
> original test target code at the heart of dm-dust; I'm still learning
> it as I go.
> 
> On the "frontend": The "bad block list" has a "grain size" of the
> block size of the device (therefore, "block 1" of a 4096-byte block
> device starts at byte offset 4096, while "block 1" of a 512-byte block
> device starts at byte offset 512.)
> 
> There is definitely value in dm-dust emulating a 4K native device, as
> it will help to reproduce bugs.  In the absence of a real device that
> is 4K native, it can be created on top of a 512-byte logical block
> size device to create a "512-byte write detector", of sorts.
> 
> (An early version of dm-dust was actually a reproducer for the commit
> "isofs: reject hardware sector size > 2048 bytes".)
> 
> > If the underlying device is a 4K native device it simply cannot handle
> > 512b IO.  At a minimum you need to verify that the underlying device can
> > even handle 512b IO.
> >
> 
> This specific case is a bug, and I want to fix it.  (During earlier
> testing, I was wondering why it was possible to set up a 512-byte
> dm-dust device on top of a 4K native device.)
> 
> I need to add a check in the "dmsetup create" process, to verify if
> the underlying device's logical_block_size is small enough to handle
> the minimum I/O size.

Would prefer to see this target accept any "block size" and _not_ use
that size for the queue_limits.  Quite a few DM targets provide such
arbitrary addressing (e.g. dm-stripe, dm-thin, dm-cache).

You'd then just verify that the user provided "block size" isn't smaller
than logical_block_size.

Any novelty of allowing the user to specify 512b vs 4K for the block
size could easily be provided by something basic like scsi_debug as the
underlying device.

Mike

  reply	other threads:[~2019-01-08 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 19:31 [RFC PATCH 0/1] dm: add dm-dust, a bad sector emulator Bryan Gurney
2019-01-07 19:31 ` [RFC PATCH 1/1] dm: add dust target Bryan Gurney
2019-01-08  0:10   ` Benjamin Marzinski
2019-01-08 15:30     ` Bryan Gurney
2019-01-08 16:23       ` Mike Snitzer
2019-01-08 19:52         ` Bryan Gurney
2019-01-08 20:29           ` Mike Snitzer [this message]
2019-01-09  1:03           ` Damien Le Moal
2019-01-09 14:29             ` SMR 512e drive firmware advertising misleading limits? [was: Re: [RFC PATCH 1/1] dm: add dust target] Mike Snitzer
2019-01-10  4:58               ` Damien Le Moal
2019-01-08 17:36       ` [RFC PATCH 1/1] dm: add dust target Benjamin Marzinski

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=20190108202920.GA22316@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=bgurney@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jdorminy@redhat.com \
    --cc=jpittman@redhat.com \
    --cc=jshimkus@redhat.com \
    --cc=tjaskiew@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.