Re: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-13 Thread Darrick J. Wong
On Fri, Nov 13, 2015 at 08:47:20AM -0700, Jens Axboe wrote: > On 11/10/2015 11:14 PM, Darrick J. Wong wrote: > >On Wed, Nov 11, 2015 at 05:30:07AM +, Seymour, Shane M wrote: > >>A quick question about this part of the patch: > >> > >>>+ uint64_t end = start + len - 1; > >> > >>>+ if (end >= i

Re: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-13 Thread Jens Axboe
On 11/10/2015 11:14 PM, Darrick J. Wong wrote: On Wed, Nov 11, 2015 at 05:30:07AM +, Seymour, Shane M wrote: A quick question about this part of the patch: + uint64_t end = start + len - 1; + if (end >= i_size_read(bdev->bd_inode)) return -EINVAL; +

RE: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-12 Thread Seymour, Shane M
> I don't have a device large enough to test for signedness errors, since > passing > huge values for start and len never make it past the i_size_read check. If you have someone trying to bypass your sanity checks then if start=18446744073709551104 and len=1024 the result of adding them togethe

RE: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-11 Thread Seymour, Shane M
> which would make the other checks I suggested to ensure that neither start > or end were more than (uint64_t)LLONG_MAX unnecessary. My apologies I was wrong about what I said above - after thinking about it for longer you still need to make sure that at least len is not greater than (uint64_t)

RE: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-11 Thread Seymour, Shane M
> I don't have a device large enough to test for signedness errors, since > passing > huge values for start and len never make it past the i_size_read check. > However, I do see that I forgot to check the padding values, so I'll update > that. Then do you want to at least consider converting end

Re: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-10 Thread Darrick J. Wong
On Wed, Nov 11, 2015 at 05:30:07AM +, Seymour, Shane M wrote: > A quick question about this part of the patch: > > > + uint64_t end = start + len - 1; > > > + if (end >= i_size_read(bdev->bd_inode)) > return -EINVAL; > > > + /* Invalidate the page cache, including dirty

RE: [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-10 Thread Seymour, Shane M
A quick question about this part of the patch: > + uint64_t end = start + len - 1; > + if (end >= i_size_read(bdev->bd_inode)) return -EINVAL; > + /* Invalidate the page cache, including dirty pages */ > + mapping = bdev->bd_inode->i_mapping; > + truncate_ino

[PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-11-09 Thread Darrick J. Wong
Create a new ioctl to expose the block layer's newfound ability to issue either a zeroing discard, a WRITE SAME with a zero page, or a regular write with the zero page. This BLKZEROOUT2 ioctl takes {start, length, flags} as parameters. So far, the only flag available is to enable the zeroing disc

Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-02-13 Thread Darrick J. Wong
So, uh, it's been a couple of weeks... Jens: Any comments? Nobody's objected to either the function or the interface; can this go in -next? --D On Wed, Jan 28, 2015 at 06:00:25PM -0800, Darrick J. Wong wrote: > Create a new ioctl to expose the block layer's newfound ability to > issue either a

Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-29 Thread Martin K. Petersen
> "Darrick" == Darrick J Wong writes: Darrick> Create a new ioctl to expose the block layer's newfound ability Darrick> to issue either a zeroing discard, a WRITE SAME with a zero Darrick> page, or a regular write with the zero page. This BLKZEROOUT2 Darrick> ioctl takes {start, length, flag

Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-29 Thread Arnd Bergmann
On Thursday 29 January 2015 11:01:02 Darrick J. Wong wrote: > It won't do all-ones, because the underlying blkdev_issue_zeroout call only > knows how to tell the device to write zeroes or perform a discard if the flag > is set and the device is whitelisted. This patch only exposes the existing > k

Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-29 Thread Darrick J. Wong
On Thu, Jan 29, 2015 at 11:02:58AM +0100, Arnd Bergmann wrote: > On Wednesday 28 January 2015 18:00:25 Darrick J. Wong wrote: > > Create a new ioctl to expose the block layer's newfound ability to > > issue either a zeroing discard, a WRITE SAME with a zero page, or a > > regular write with the zer

RE: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-29 Thread Elliott, Robert (Server Storage)
org; linux- > fsde...@vger.kernel.org; linux-...@vger.kernel.org; Jeff Layton; J. Bruce > Fields > Subject: Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a > range of blocks > > On Wednesday 28 January 2015 18:00:25 Darrick J. Wong wrote: > > Create a new

Re: [RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-29 Thread Arnd Bergmann
On Wednesday 28 January 2015 18:00:25 Darrick J. Wong wrote: > Create a new ioctl to expose the block layer's newfound ability to > issue either a zeroing discard, a WRITE SAME with a zero page, or a > regular write with the zero page. This BLKZEROOUT2 ioctl takes > {start, length, flags} as param

[RESEND] [PATCH] block: create ioctl to discard-or-zeroout a range of blocks

2015-01-28 Thread Darrick J. Wong
Create a new ioctl to expose the block layer's newfound ability to issue either a zeroing discard, a WRITE SAME with a zero page, or a regular write with the zero page. This BLKZEROOUT2 ioctl takes {start, length, flags} as parameters. So far, the only flag available is to enable the zeroing disc