On Fri, Aug 27 2010 at 7:28pm -0400,
Tejun Heo <tj@kernel.org> wrote:
Actually only alloc_dev() allocates the queue. It'll then initialize it
for bio-based use via dm_init_md_queue() -- this initialization is
subset of that done for a request-based DM device's queue. The
remaining queue initialization for rq-based is done in
dm_init_request_based_queue -- with the call to
blk_init_allocated_queue().
So the request-based queue is initialized in two stages.
dm_init_md_queue() is common to both both bio-based and request-based.
So we probably only need the one blk_queue_flush in dm_init_md_queue().
I thought that was likely the case, thanks for clarifying.
OK, like I mentioned earlier in one of these threads; its easy enough to
use multipath with a single scsi-debug device. That way you can also
create a discard capable multipath device without physical hardware,
e.g.:
# modprobe scsi_debug dev_size_mb=100 unmap_max_desc=16 unmap_granularity=2048 sector_size=4096
<edit multipath.conf to not blacklist all devices, also enable
'user_friendly_names yes' in defaults section>
# /etc/init.d/multipathd restart
# multipath -ll
From here you can just format the mpath device with ext4 or whatever.
But if you want to use LVM ontop of the multipath device you'll need to
allow LVM to treat DM devices as physical volumes, see FAQ #3 here:
http://christophe.varoqui.free.fr/faq.html
It also helps to tweak your 'preferred_names' and 'filter' in lvm.conf,
e.g.:
preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
filter = [ "a|/dev/mapper/mpatha|", "a|/dev/vd.*|", "a|/dev/sdd|", "a|/dev/sde|", "r|.*|" ]
The 'lvmdiskscan' command should show the mpath device.
Now you can use that test script I provided in my earlier mail.
Mike
--