Re: [PATCH] block: correctly fallback for zeroout

2016-06-02 Thread Martin K. Petersen
> "Shaohua" == Shaohua Li writes: Shaohua> blkdev_issue_zeroout try discard/writesame first, if they fail, Shaohua> zeroout fallback to regular write. The problem is Shaohua> discard/writesame doesn't return error for -EOPNOTSUPP, then Shaohua> zeroout can't do fallback and leave disk data no

Re: [PATCH] block: correctly fallback for zeroout

2016-06-02 Thread Martin K. Petersen
> "Christoph" == Christoph Hellwig writes: Christoph> As part of that I also removed the strange EOPNOTSUPP ignore, Christoph> but Mike reverted it just because it changed something in the Christoph> dm testsuite. Mike? Christoph> I still believe we should never ignore it in this helper, an

Re: [PATCH] block: correctly fallback for zeroout

2016-06-02 Thread Martin K. Petersen
> "Sitsofe" == Sitsofe Wheeler writes: Sitsofe> The original SCSI WRITE SAME has overloaded semantics - not Sitsofe> only does it mean "write this data multiple times" but it can Sitsofe> also be used to mean "discard this range" too. If the kernel's Sitsofe> command was modelled on the SCSI

Re: [PATCH] block: correctly fallback for zeroout

2016-06-02 Thread Martin K. Petersen
> "Shaohua" == Shaohua Li writes: Shaohua> any chance you could merge this one? I'll fix the MD part later Shaohua> and make sure write_same_max_bytes sets to 0 after IO failure. I'd like to look it over first. I've been away for a few days. Will get to it today. -- Martin K. Petersen

Re: [PATCH] block: correctly fallback for zeroout

2016-06-02 Thread Shaohua Li
On Sat, May 28, 2016 at 10:27:55AM +0100, Sitsofe Wheeler wrote: > On Sat, May 28, 2016 at 08:55:43AM +, Sitsofe Wheeler wrote: > > On Thu, May 26, 2016 at 11:08:14AM -0700, Shaohua Li wrote: > > > blkdev_issue_zeroout try discard/writesame first, if they fail, zeroout > > > fallback to regular

Re: [PATCH] block: correctly fallback for zeroout

2016-05-28 Thread Christoph Hellwig
On Thu, May 26, 2016 at 11:08:14AM -0700, Shaohua Li wrote: > -int blkdev_issue_discard(struct block_device *bdev, sector_t sector, > - sector_t nr_sects, gfp_t gfp_mask, unsigned long flags) > +static int do_blkdev_issue_discard(struct block_device *bdev, sector_t > sector, We've spl

Re: [PATCH] block: correctly fallback for zeroout

2016-05-28 Thread Sitsofe Wheeler
On Sat, May 28, 2016 at 08:55:43AM +, Sitsofe Wheeler wrote: > On Thu, May 26, 2016 at 11:08:14AM -0700, Shaohua Li wrote: > > blkdev_issue_zeroout try discard/writesame first, if they fail, zeroout > > fallback to regular write. The problem is discard/writesame doesn't > > return error for -EO

[PATCH] block: correctly fallback for zeroout

2016-05-26 Thread Shaohua Li
blkdev_issue_zeroout try discard/writesame first, if they fail, zeroout fallback to regular write. The problem is discard/writesame doesn't return error for -EOPNOTSUPP, then zeroout can't do fallback and leave disk data not changed. zeroout should have guaranteed zero-fill behavior. BTW, I saw se