Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
On Mon, Oct 16, 2017 at 1:44 PM, Christoph Hellwig wrote: > On Fri, Oct 06, 2017 at 02:31:20PM +0200, Ilya Dryomov wrote: >> This would unconditionally overwrite any WRITE ZEROS error. If we get >> e.g. -EIO, and manual zeroing is not allowed, I don't think we want to >>

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Christoph Hellwig
On Fri, Oct 06, 2017 at 02:31:20PM +0200, Ilya Dryomov wrote: > This would unconditionally overwrite any WRITE ZEROS error. If we get > e.g. -EIO, and manual zeroing is not allowed, I don't think we want to > return -EOPNOTSUPP? > > Returning -EOPNOTSUPP to mean "can't zero using either method"

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
On Fri, Oct 6, 2017 at 2:31 PM, Ilya Dryomov wrote: > On Fri, Oct 6, 2017 at 2:05 PM, Christoph Hellwig wrote: >> On Thu, Oct 05, 2017 at 09:32:33PM +0200, Ilya Dryomov wrote: >>> This is to avoid returning -EREMOTEIO in the following case: device >>>

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-06 Thread Ilya Dryomov
On Fri, Oct 6, 2017 at 2:05 PM, Christoph Hellwig wrote: > On Thu, Oct 05, 2017 at 09:32:33PM +0200, Ilya Dryomov wrote: >> This is to avoid returning -EREMOTEIO in the following case: device >> doesn't support WRITE SAME but scsi_disk::max_ws_blocks != 0, zeroout >> is called

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-06 Thread Christoph Hellwig
On Thu, Oct 05, 2017 at 09:32:33PM +0200, Ilya Dryomov wrote: > This is to avoid returning -EREMOTEIO in the following case: device > doesn't support WRITE SAME but scsi_disk::max_ws_blocks != 0, zeroout > is called with BLKDEV_ZERO_NOFALLBACK. Enter blkdev_issue_zeroout(), >

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-05 Thread Ilya Dryomov
On Thu, Oct 5, 2017 at 7:13 PM, Christoph Hellwig wrote: > On Wed, Oct 04, 2017 at 05:03:16PM +0200, Ilya Dryomov wrote: >> sd_config_write_same() ignores ->max_ws_blocks == 0 and resets it to >> permit trying WRITE SAME on older SCSI devices, unless ->no_write_same >> is set.

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-05 Thread Christoph Hellwig
On Wed, Oct 04, 2017 at 05:03:16PM +0200, Ilya Dryomov wrote: > sd_config_write_same() ignores ->max_ws_blocks == 0 and resets it to > permit trying WRITE SAME on older SCSI devices, unless ->no_write_same > is set. Because REQ_OP_WRITE_ZEROES is implemented in terms of WRITE > SAME,

[PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-04 Thread Ilya Dryomov
sd_config_write_same() ignores ->max_ws_blocks == 0 and resets it to permit trying WRITE SAME on older SCSI devices, unless ->no_write_same is set. Because REQ_OP_WRITE_ZEROES is implemented in terms of WRITE SAME, blkdev_issue_zeroout() may fail with -EREMOTEIO: $ fallocate -zn -l 1k /dev/sdg