Thread (11 messages) 11 messages, 2 authors, 2017-10-16

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

From: Christoph Hellwig <hch@infradead.org>
Date: 2017-10-06 12:05:31

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(),
bdev_write_zeroes_sectors() != 0, so we issue WRITE ZEROES.  The
request fails with ILLEGAL REQUEST, sd_done() sets ->no_write_same and
updates queue_limits, ILLEGAL REQUEST is translated into -EREMOTEIO,
which is returned from submit_bio_wait().  Manual zeroing is not
allowed, so we must return an error, but it shouldn't be -EREMOTEIO if
queue_limits just got updated because of ILLEGAL REQUEST.  Without this
conditional, we'd get
Hmm.  I think we'd better off to just do the before the retry loop:

	if (ret && try_write_zeroes) {
		if (!(flags & BLKDEV_ZERO_NOFALLBACK))
			try_write_zeroes = false;
			goto retry;
		}
		ret = -EOPNOTSUPP;
	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help