From: Mike Snitzer <snitzer@redhat.com>
To: Josef Bacik <jbacik@fb.com>
Cc: dm-devel@redhat.com
Subject: Re: Question about dm target size
Date: Tue, 11 Nov 2014 21:06:41 -0500 [thread overview]
Message-ID: <20141112020641.GA15589@redhat.com> (raw)
In-Reply-To: <5462ABD8.1050609@fb.com>
On Tue, Nov 11 2014 at 7:37pm -0500,
Josef Bacik <jbacik@fb.com> wrote:
> Hello,
>
> I'm creating a dm target to better test power fail situations and
> I'm having trouble figuring out how to make the dm device appear as
> a different size. So for example you do the normal dm table
>
> offset size power-fail /dev/whatever args
So "size" should be constrained to:
size=$(sudo blockdev --getsz /dev/whatever); $((size/2))
> I want to use the entire size of /dev/whatever, but I want my dm
> device to show up as size/2. So right now I'm doing this in my
> ->ctr function
>
> ti->len /= 2;
You don't want to mess with ti->len. If you have "size" be size/2
then ti->len will automatically reflect that.
But anyway, I'm mot really following how you'd map the entire
/dev/whatever but only expose half its size to the user. What would the
target's ->map function be doing?
> Is that acceptable, or will this have some side-effect that's going
> to bite me in the ass? I can't see any other target that does
> something similar and there appears to be no helper function. This
> seems to work as far as blockdev --getsz is concerned, but I'm
> worried I need to do more. Thanks,
dm-thinp is all about establishing thin volumes of fictional size...
wondering what kind of helper you were hoping to find.
The target's ->ctr would open /dev/whatever and internalize
/dev/whatever's size and ->map would deal with remapping of bios sent to
the target over to /dev/whatever.
next prev parent reply other threads:[~2014-11-12 2:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 0:37 Question about dm target size Josef Bacik
2014-11-12 2:06 ` Mike Snitzer [this message]
2014-11-12 2:30 ` Josef Bacik
2014-11-12 8:45 ` Zdenek Kabelac
2014-11-12 11:00 ` Josef Bacik
2014-11-12 11:48 ` Zdenek Kabelac
2014-11-12 11:15 ` Heinz Mauelshagen
2014-11-12 12:28 ` Bryn M. Reeves
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=20141112020641.GA15589@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=jbacik@fb.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.