On Thu, Sep 07, 2017 at 03:20:01PM +0200, Ilya Dryomov wrote: > Hi Shaohua, > > You wrote: > > BTW: blkdev_issue_zeroout retries if we immediately find the device doesn't > > support zeroout, but it doesn't retry if submit_bio_wait returns -EOPNOTSUPP. > > Is this correct behavior? > > I sent a patch for that yesterday, see "[PATCH] block: cope with WRITE > SAME failing in blkdev_issue_zeroout()" on linux-block. It checks for > -EREMOTEIO, because that's what I hit, but I wonder if it should check > for -EOPNOTSUPP from submit_bio_wait() as well. Can you think of > a case where, given bdev_write_zeroes_sectors() != 0, submit_bio_wait() > would fail with -EOPNOTSUPP and we would want to do explicit zeroing? loop block device returns -EOPNOTSUPP before for zeroout. With the second patch, it doesn't any more though.