From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] dm-raid: add RAID discard support Date: Wed, 24 Sep 2014 07:21:49 -0700 Message-ID: <20140924142149.GA3858@infradead.org> References: <1411491106-23676-1-git-send-email-heinzm@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: "Martin K. Petersen" Cc: Heinz Mauelshagen , device-mapper development List-Id: dm-devel.ids On Tue, Sep 23, 2014 at 07:07:35PM -0400, Martin K. Petersen wrote: > >>>>> "Heinz" == heinzm writes: > > Heinz> In case of RAID levels 4,5 and 6 we have to check for the > Heinz> capability to zero data on discards to avoid stripe data > Heinz> corruption. > > I'm quite concerned about relying on discard_zeroes_data since it's a > hint and not a hard guarantee. If we want to provide useful discards through raid we need to make it a hard guarantee. That is: - only set it when using a WRITE SAME variant on scsi - start adding a whitelist for ATA Relying on zeroout which also works when it doesn't unmap below is not the answer, especially if it may end up doing a physical write of zeroes on disk devices. Alternatively we could get rid of discard_zeroes_data and stop the pretence of any sane behavior from discard, and instead expose an unmap bit through the blkdev_issue_zeroout stack for those callers who want to do a discard, but rely on zeroes. The end effect will be the same, just a different presentation.