[dm-devel] [PATCH] dm table: fix logic bug in dm_table_supports_write_same [was: Re: BLKZEROOUT on dm devices]
Bharata B Rao
bharata.rao at gmail.com
Wed May 1 06:58:27 UTC 2013
On Tue, Apr 30, 2013 at 10:02 PM, Mike Snitzer <snitzer at redhat.com> wrote:
> On Tue, Apr 30 2013 at 12:07am -0400,
> Bharata B Rao <bharata.rao at gmail.com> wrote:
>
>>
>> # lsblk
>> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
>> sda 8:0 0 50G 0 disk
>> └─mpathb (dm-12) 252:12 0 50G 0 mpath
>> └─ws_vg-lvol0 (dm-11) 252:11 0 1G 0 lvm
>> sde 8:64 0 50G 0 disk
>> └─mpathb (dm-12) 252:12 0 50G 0 mpath
>> └─ws_vg-lvol0 (dm-11) 252:11 0 1G 0 lvm
>>
>
>
> Anyway, this patch fixes things for me:
Thanks, this fixes the issue for me too. However if LV/VG/PV are
created on multipath device, then WRITE SAME still doesn't get
advertised for the LV. I had to disable multipath and re-create
LV/VG/PV on a normal device (/dev/sda as against /dev/mapper/mapathb)
to get BLKZEROUT working on LV.
>
> From: Mike Snitzer <snitzer at redhat.com>
> Date: Tue, 30 Apr 2013 12:24:58 -0400
> Subject: [PATCH] dm table: fix logic bug in dm_table_supports_write_same
>
> If device_not_write_same_capable() returns true then the iterate_devices
> loop in dm_table_supports_write_same() should return false.
>
> Reported-by: Bharata B Rao <bharata.rao at gmail.com>
> Signed-off-by: Mike Snitzer <snitzer at redhat.com>
> Cc: stable at vger.kernel.org # v3.8+
> ---
> drivers/md/dm-table.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 3fe797f..d801682 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -1445,7 +1445,7 @@ static bool dm_table_supports_write_same(struct dm_table *t)
> return false;
>
> if (!ti->type->iterate_devices ||
> - !ti->type->iterate_devices(ti, device_not_write_same_capable, NULL))
> + ti->type->iterate_devices(ti, device_not_write_same_capable, NULL))
> return false;
> }
>
> --
> 1.7.1
>
--
http://raobharata.wordpress.com/
More information about the dm-devel
mailing list