From mboxrd@z Thu Jan 1 00:00:00 1970 From: "zhangxiaoxu (A)" Subject: Re: block: Fix a WRITE SAME BUG_ON Date: Tue, 12 Feb 2019 11:11:29 +0800 Message-ID: References: <20190125021107.4595-1-zhangxiaoxu5@huawei.com> <20190128221441.GA24102@redhat.com> <20190131103924.GA22503@infradead.org> <20190201073527.GA14758@infradead.org> <20190201161803.GA21124@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190201161803.GA21124@infradead.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Christoph Hellwig , Heinz Mauelshagen , John Dorminy Cc: axboe@kernel.dk, "Martin K. Petersen" , Mike Snitzer , linux-block@vger.kernel.org, dm-devel@redhat.com, Alasdair G Kergon List-Id: dm-devel.ids Any progress about the problme? Should we disable the write same when stack the different LBA disks? On 2/2/2019 12:18 AM, Christoph Hellwig wrote: > On Fri, Feb 01, 2019 at 05:03:40PM +0100, Heinz Mauelshagen wrote: >> On 2/1/19 3:09 PM, John Dorminy wrote: >>> I didn't know such a thing existed... does it work on any block >>> device? Where do I read more about this? >> >> >> Use sg_write_same(8) from package sg3_utils. >> >> For instance 'sg_write_same --in=foobarfile --lba=0 --num=20000 >> --xferlen=512 /dev/sdwhatever' >> >> will read the pattern to write same from file 'foobarfile' with length >> explicitely set to 512 bytes >> (rather than derived from foobarfile's size) and write it 20000 times >> starting at LBA 0 to /dev/sdwhatever. > > Yeah. Note that this will only work on SCSI disks (and maybe ATA > for a very specific corner case). But for actual devices and not > remappers the same is true of REQ_OP_WRITE_SAME. > > . >