[f2fs-dev] [PATCH] f2fs: fix leaking uninitialized memory in compressed clusters

2020-02-20 Thread Eric Biggers
From: Eric Biggers When the compressed data of a cluster doesn't end on a page boundary, the remainder of the last page must be zeroed in order to avoid leaking uninitialized memory to disk. Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Eric Biggers --- fs/f2fs/compress

Re: [f2fs-dev] [PATCH v7 10/24] mm: Add readahead address space operation

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > This replaces ->readpages with a saner interface: > - Return void instead of an ignored error code. > - Page cache is already populated with locked pages when ->readahead >is called. > - New arguments can be pa

Re: [f2fs-dev] [PATCH v7 04/24] mm: Move readahead nr_pages check into read_pages

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Simplify the callers by moving the check for nr_pages and the BUG_ON > into read_pages(). > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/readahead.c | 12 +++- > 1 file changed, 7 insertions(+), 5 de

Re: [f2fs-dev] [PATCH v7 09/24] mm: Put readahead pages in cache earlier

2020-02-20 Thread John Hubbard
On 2/20/20 7:43 PM, Matthew Wilcox wrote: > On Thu, Feb 20, 2020 at 07:19:58PM -0800, John Hubbard wrote: >>> +static inline struct page *readahead_page(struct readahead_control *rac) >>> +{ >>> + struct page *page; >>> + >>> + BUG_ON(rac->_batch_count > rac->_nr_pages); >>> + rac->_nr_pages

Re: [f2fs-dev] [PATCH v7 11/24] mm: Move end_index check out of readahead loop

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > By reducing nr_to_read, we can eliminate this check from inside the loop. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/readahead.c | 15 +-- > 1 file changed, 9 insertions(+), 6 deletions(-) >

Re: [f2fs-dev] [PATCH v7 09/24] mm: Put readahead pages in cache earlier

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:19:58PM -0800, John Hubbard wrote: > > +static inline struct page *readahead_page(struct readahead_control *rac) > > +{ > > + struct page *page; > > + > > + BUG_ON(rac->_batch_count > rac->_nr_pages); > > + rac->_nr_pages -= rac->_batch_count; > > + rac->_index +=

Re: [f2fs-dev] [PATCH v7 06/24] mm: Rename various 'offset' parameters to 'index'

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > The word 'offset' is used ambiguously to mean 'byte offset within > a page', 'byte offset from the start of the file' and 'page offset > from the start of the file'. Use 'index' to mean 'page offset > from the start

Re: [f2fs-dev] [PATCH v7 09/24] mm: Put readahead pages in cache earlier

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > When populating the page cache for readahead, mappings that use > ->readpages must populate the page cache themselves as the pages are > passed on a linked list which would normally be used for the page cache's > LRU.

Re: [f2fs-dev] [PATCH v7 08/24] mm: Remove 'page_offset' from readahead loop

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Replace the page_offset variable with 'index + i'. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/readahead.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/mm/readahead.c

Re: [f2fs-dev] [PATCH v7 01/24] mm: Move readahead prototypes from mm.h

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > The readahead code is part of the page cache so should be found in the > pagemap.h file. force_page_cache_readahead is only used within mm, > so move it to mm/internal.h instead. Remove the parameter names where > t

Re: [f2fs-dev] [PATCH v7 06/24] mm: Rename various 'offset' parameters to 'index'

2020-02-20 Thread John Hubbard
On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > The word 'offset' is used ambiguously to mean 'byte offset within > a page', 'byte offset from the start of the file' and 'page offset > from the start of the file'. Use 'index' to mean 'page offset > from the start

Re: [f2fs-dev] [PATCH v7 00/23] Change readahead API

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 06:54:00PM +0100, David Sterba wrote: > On Wed, Feb 19, 2020 at 01:00:39PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > This series adds a readahead address_space operation to eventually > > replace the readpages operation. The key difference i

Re: [f2fs-dev] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-20 Thread Christoph Hellwig
On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Use the new readahead operation in iomap. Convert XFS and ZoneFS to > use it. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/iomap/buffered-io.c | 90 +++---

Re: [f2fs-dev] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:46:58AM -0800, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:48:49AM -0800, Matthew Wilcox wrote: > > btrfs: Convert from readpages to readahead > > > > Implement the new readahead method in btrfs. Add a readahead_page_batch() > > to optimise fetching a batch

Re: [f2fs-dev] [PATCH v7 10/24] mm: Add readahead address space operation

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 10:00:30AM -0500, Zi Yan wrote: > > +/* The index of the first page in this readahead block */ > > +static inline unsigned int readahead_index(struct readahead_control *rac) > > +{ > > + return rac->_index; > > +} > > rac->_index is pgoff_t, so readahead_index() should re

Re: [f2fs-dev] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:49:12AM -0800, Christoph Hellwig wrote: > > +/** > > + * iomap_readahead - Attempt to read pages from a file. > > + * @rac: Describes the pages to be read. > > + * @ops: The operations vector for the filesystem. > > + * > > + * This function is for filesystems to call to

Re: [f2fs-dev] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:47:41AM -0800, Christoph Hellwig wrote: > On Wed, Feb 19, 2020 at 01:01:00PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > By putting the 'have we reached the end of the page' condition at the end > > of the loop instead of the beginning, we c

Re: [f2fs-dev] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-20 Thread Christoph Hellwig
On Wed, Feb 19, 2020 at 01:01:00PM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > By putting the 'have we reached the end of the page' condition at the end > of the loop instead of the beginning, we can remove the 'submit the last > page' code from iomap_readpages(). Also che

Re: [f2fs-dev] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Christoph Hellwig
On Thu, Feb 20, 2020 at 05:48:49AM -0800, Matthew Wilcox wrote: > btrfs: Convert from readpages to readahead > > Implement the new readahead method in btrfs. Add a readahead_page_batch() > to optimise fetching a batch of pages at once. Shouldn't this readahead_page_batch heper go into a separa

Re: [f2fs-dev] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Christoph Hellwig
On Thu, Feb 20, 2020 at 07:54:52AM -0800, Matthew Wilcox wrote: > On Thu, Feb 20, 2020 at 07:46:58AM -0800, Christoph Hellwig wrote: > > On Thu, Feb 20, 2020 at 05:48:49AM -0800, Matthew Wilcox wrote: > > > btrfs: Convert from readpages to readahead > > > > > > Implement the new readahead method

Re: [f2fs-dev] [PATCH v7 00/23] Change readahead API

2020-02-20 Thread David Sterba
On Wed, Feb 19, 2020 at 01:00:39PM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > This series adds a readahead address_space operation to eventually > replace the readpages operation. The key difference is that > pages are added to the page cache as they are allocated (and >

Re: [f2fs-dev] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 09:42:19AM +, Johannes Thumshirn wrote: > On 19/02/2020 22:03, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Use the new readahead operation in btrfs. Add a > > readahead_for_each_batch() iterator to optimise the loop in the XArray. > > OK I must

Re: [f2fs-dev] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Johannes Thumshirn
On 19/02/2020 22:03, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Use the new readahead operation in btrfs. Add a > readahead_for_each_batch() iterator to optimise the loop in the XArray. OK I must admit I haven't followed this series closely, but what happened to said readahea