From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103AbcE0Ept (ORCPT ); Fri, 27 May 2016 00:45:49 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:36759 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbcE0Epr (ORCPT ); Fri, 27 May 2016 00:45:47 -0400 MIME-Version: 1.0 In-Reply-To: <20160527041824.GC9418@birch.djwong.org> References: <20160518223616.GA409@sucs.org> <20160527041824.GC9418@birch.djwong.org> Date: Fri, 27 May 2016 05:45:46 +0100 Message-ID: Subject: Re: BLKZEROOUT not zeroing md dev on VMDK From: Sitsofe Wheeler To: "Darrick J. Wong" Cc: Shaohua Li , Jens Axboe , Arvind Kumar , VMware PV-Drivers , linux-raid@vger.kernel.org, "linux-scsi@vger.kernel.org" , linux-block@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 May 2016 at 05:18, Darrick J. Wong wrote: > > It's possible that the pvscsi device advertised WRITE SAME, but if the device > sends back ILLEGAL REQUEST then the SCSI disk driver will set > write_same_max_bytes=0. Subsequent BLKZEROOUT attempts will then issue writes > of zeroes to the drive. Thanks for following up on this but that's not what happens on the md device - you can go on to issue as many BLKZEROOUT requests as you like but the md disk is never zeroed nor is an error returned. I filed a bug at https://bugzilla.kernel.org/show_bug.cgi?id=118581 (see https://bugzilla.kernel.org/show_bug.cgi?id=118581#c6 for alternative reproduction steps that use scsi_debug and can be reworked to impact device mapper) and Shaohua Li noted that blkdev_issue_write_same could return 0 even when the disk didn't support write same (see https://bugzilla.kernel.org/show_bug.cgi?id=118581#c8 ). Shaohua went on to create a patch for this ("block: correctly fallback for zeroout" - https://patchwork.kernel.org/patch/9137311/ ) which has yet to be reviewed. -- Sitsofe | http://sucs.org/~sits/