Re: [Cluster-devel] [PATCH 1/4] gfs2: stop using generic_writepages in gfs2_ail1_start_one

2023-01-18 Thread Christoph Hellwig
On Wed, Jan 18, 2023 at 10:22:20PM +0100, Andreas Gruenbacher wrote: > The above change means that instead of calling generic_writepages(), > we end up calling filemap_fdatawrite_wbc() -> do_writepages() -> > mapping->a_ops->writepages(). But that's something completely > different; the writepages

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-18 Thread Damien Le Moal
On 1/18/23 16:21, Christoph Hellwig wrote: > On Sun, Jan 15, 2023 at 09:29:58AM -0800, Darrick J. Wong wrote: >> I don't have any objections to pulling everything except patches 8 and >> 10 for testing this week. > > That would be great. I now have a series to return the ERR_PTR > from

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-18 Thread Christoph Hellwig
On Sun, Jan 15, 2023 at 09:29:58AM -0800, Darrick J. Wong wrote: > I don't have any objections to pulling everything except patches 8 and > 10 for testing this week. That would be great. I now have a series to return the ERR_PTR from __filemap_get_folio which will cause a minor conflict, but I

Re: [Cluster-devel] [PATCH 9/9] mm: return an ERR_PTR from __filemap_get_folio

2023-01-18 Thread Ryusuke Konishi
On Wed, Jan 18, 2023 at 7:41 PM Christoph Hellwig wrote: > > Instead of returning NULL for all errors, distinguish between: > > - no entry found and not asked to allocated (-ENOENT) > - failed to allocate memory (-ENOMEM) > - would block (-EAGAIN) > > so that callers don't have to guess the

[Cluster-devel] [PATCH 9/9] mm: return an ERR_PTR from __filemap_get_folio

2023-01-18 Thread Christoph Hellwig
Instead of returning NULL for all errors, distinguish between: - no entry found and not asked to allocated (-ENOENT) - failed to allocate memory (-ENOMEM) - would block (-EAGAIN) so that callers don't have to guess the error based on the passed in flags. Also pass through the error through

[Cluster-devel] [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io

2023-01-18 Thread Christoph Hellwig
filemap_get_folio can return NULL, skip those cases. Signed-off-by: Christoph Hellwig --- fs/btrfs/extent_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d55e4531ffd212..a54d2cf74ba020 100644 --- a/fs/btrfs/extent_io.c +++

[Cluster-devel] [PATCH 5/9] shmem: open code the page cache lookup in shmem_get_folio_gfp

2023-01-18 Thread Christoph Hellwig
Use the very low level filemap_get_entry helper to look up the entry in the xarray, and then: - don't bother locking the folio if only doing a userfault notification - open code locking the page and checking for truncation in a related code block This will allow to eventually remove the

[Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Christoph Hellwig
filemap_get_folio can return NULL, so exit early for that case. Signed-off-by: Christoph Hellwig --- fs/gfs2/lops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 1902413d5d123e..51d4b610127cdb 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@

[Cluster-devel] [PATCH 6/9] mm: remove FGP_ENTRY

2023-01-18 Thread Christoph Hellwig
FGP_ENTRY is unused now, so remove it. Signed-off-by: Christoph Hellwig --- include/linux/pagemap.h | 3 +-- mm/filemap.c| 7 +-- mm/folio-compat.c | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h

[Cluster-devel] [PATCH 4/9] shmem: remove shmem_get_partial_folio

2023-01-18 Thread Christoph Hellwig
Add a new SGP_FIND mode for shmem_get_partial_folio that works like SGP_READ, but does not check i_size. Use that instead of open coding the page cache lookup in shmem_get_partial_folio. Note that this is a behavior change in that it reads in swap cache entries for offsets outside i_size,

[Cluster-devel] [PATCH 1/9] mm: don't look at xarray value entries in split_huge_pages_in_file

2023-01-18 Thread Christoph Hellwig
split_huge_pages_in_file never wants to do anything with the special value enties. Switch to using filemap_get_folio to not even see them. Signed-off-by: Christoph Hellwig --- mm/huge_memory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/huge_memory.c

[Cluster-devel] [PATCH 3/9] mm: use filemap_get_entry in filemap_get_incore_folio

2023-01-18 Thread Christoph Hellwig
filemap_get_incore_folio wants to look at the details of xa_is_value entries, but doesn't need any of the other logic in filemap_get_folio. Switch it to use the lower-level filemap_get_entry interface. Signed-off-by: Christoph Hellwig --- mm/swap_state.c | 2 +- 1 file changed, 1 insertion(+),

[Cluster-devel] return an ERR_PTR from __filemap_get_folio

2023-01-18 Thread Christoph Hellwig
Hi all, __filemap_get_folio and its wrappers can return NULL for three different conditions, which in some cases requires the caller to reverse engineer the decision making. This is fixed by returning an ERR_PTR instead of NULL and thus transporting the reason for the failure. But to make that

[Cluster-devel] [PATCH 2/9] mm: make mapping_get_entry available outside of filemap.c

2023-01-18 Thread Christoph Hellwig
mapping_get_entry is useful for page cache API users that need to know about xa_value internals. Rename it and make it available in pagemap.h. Signed-off-by: Christoph Hellwig --- include/linux/pagemap.h | 1 + mm/filemap.c| 6 +++--- 2 files changed, 4 insertions(+), 3

Re: [Cluster-devel] [PATCH 3/9] mm: use filemap_get_entry in filemap_get_incore_folio

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:23AM +0100, Christoph Hellwig wrote: > filemap_get_incore_folio wants to look at the details of xa_is_value > entries, but doesn't need any of the other logic in filemap_get_folio. > Switch it to use the lower-level filemap_get_entry interface. > > Signed-off-by:

Re: [Cluster-devel] [PATCH 9/9] mm: return an ERR_PTR from __filemap_get_folio

2023-01-18 Thread Christoph Hellwig
On Wed, Jan 18, 2023 at 09:39:08PM +0900, Ryusuke Konishi wrote: > > Also pass through the error through the direct callers: > > > filemap_get_folio, filemap_lock_folio filemap_grab_folio > > and filemap_get_incore_folio. > > As for the comments describing the return values of these callers, >

Re: [Cluster-devel] [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io

2023-01-18 Thread Christoph Hellwig
On Wed, Jan 18, 2023 at 04:08:57PM +, Matthew Wilcox wrote: > On Wed, Jan 18, 2023 at 10:43:28AM +0100, Christoph Hellwig wrote: > > filemap_get_folio can return NULL, skip those cases. > > Hmm, I'm not sure that's true. We have one place that calls > extent_range_redirty_for_io(), and it

Re: [Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Christoph Hellwig
On Wed, Jan 18, 2023 at 05:24:32PM +0100, Andreas Gruenbacher wrote: > We're actually still holding a reference to the folio from the > find_or_create_page() in gfs2_find_jhead() here, so we know that > memory pressure can't push the page out and filemap_get_folio() won't > return NULL. Ok, I'll

Re: [Cluster-devel] [PATCH 4/9] shmem: remove shmem_get_partial_folio

2023-01-18 Thread Christoph Hellwig
On Wed, Jan 18, 2023 at 08:57:05AM -0500, Brian Foster wrote: > This all seems reasonable to me at a glance, FWIW, but I am a little > curious why this wouldn't split up into two changes. I.e., switch this > over to filemap_get_entry() to minimally remove the FGP_ENTRY dependency > without a

Re: [Cluster-devel] [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:28AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, skip those cases. Hmm, I'm not sure that's true. We have one place that calls extent_range_redirty_for_io(), and it previously calls extent_range_clear_dirty_for_io() which has an explicit

Re: [Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Andreas Gruenbacher
[Christoph's email ended up in my spam folder; I hope that was a one-time-only occurrence.] On Wed, Jan 18, 2023 at 5:00 PM Matthew Wilcox wrote: > On Wed, Jan 18, 2023 at 10:43:27AM +0100, Christoph Hellwig wrote: > > filemap_get_folio can return NULL, so exit early for that case. > > I'm not

Re: [Cluster-devel] [PATCH 4/9] shmem: remove shmem_get_partial_folio

2023-01-18 Thread Brian Foster
On Wed, Jan 18, 2023 at 10:43:24AM +0100, Christoph Hellwig wrote: > Add a new SGP_FIND mode for shmem_get_partial_folio that works like > SGP_READ, but does not check i_size. Use that instead of open coding > the page cache lookup in shmem_get_partial_folio. Note that this is > a behavior

Re: [Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:27AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, so exit early for that case. I'm not sure it can return NULL in this specific case. As I understand this code, we're scanning the journal looking for the log head. We've just submitted the

Re: [Cluster-devel] [syzbot] INFO: task hung in freeze_super (3)

2023-01-18 Thread Tetsuo Handa
Ping? On 2023/01/04 22:47, Tetsuo Handa wrote: > I suspect that cleanup is not done appropriately when gfs2_find_jhead() > failed. > Looking into gfs2_make_fs_rw(), I see there are two worrisome things. > > One is that gfs2_make_fs_rw() returns an error without calling > gfs2_consist(sdp) when

Re: [Cluster-devel] [PATCH 1/9] mm: don't look at xarray value entries in split_huge_pages_in_file

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:21AM +0100, Christoph Hellwig wrote: > split_huge_pages_in_file never wants to do anything with the special > value enties. Switch to using filemap_get_folio to not even see them. > > Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 2/9] mm: make mapping_get_entry available outside of filemap.c

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:22AM +0100, Christoph Hellwig wrote: > mapping_get_entry is useful for page cache API users that need to know > about xa_value internals. Rename it and make it available in pagemap.h. > > Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 4/9] shmem: remove shmem_get_partial_folio

2023-01-18 Thread Brian Foster
On Wed, Jan 18, 2023 at 05:43:58PM +0100, Christoph Hellwig wrote: > On Wed, Jan 18, 2023 at 08:57:05AM -0500, Brian Foster wrote: > > This all seems reasonable to me at a glance, FWIW, but I am a little > > curious why this wouldn't split up into two changes. I.e., switch this > > over to

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-18 Thread Andreas Grünbacher
Am Mi., 18. Jan. 2023 um 20:04 Uhr schrieb Darrick J. Wong : > > On Tue, Jan 17, 2023 at 11:21:38PM -0800, Christoph Hellwig wrote: > > On Sun, Jan 15, 2023 at 09:29:58AM -0800, Darrick J. Wong wrote: > > > I don't have any objections to pulling everything except patches 8 and > > > 10 for testing

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-18 Thread Darrick J. Wong
On Tue, Jan 17, 2023 at 11:21:38PM -0800, Christoph Hellwig wrote: > On Sun, Jan 15, 2023 at 09:29:58AM -0800, Darrick J. Wong wrote: > > I don't have any objections to pulling everything except patches 8 and > > 10 for testing this week. > > That would be great. I now have a series to return

Re: [Cluster-devel] [PATCH 1/4] gfs2: stop using generic_writepages in gfs2_ail1_start_one

2023-01-18 Thread Andreas Gruenbacher
Hi Christoph, On Tue, Jul 19, 2022 at 7:07 AM Christoph Hellwig wrote: > > Use filemap_fdatawrite_wbc instead of generic_writepages in > gfs2_ail1_start_one so that the functin can also cope with address_space > operations that only implement ->writepages and to properly account > for cgroup

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-18 Thread Dave Chinner
On Sun, Jan 15, 2023 at 09:29:58AM -0800, Darrick J. Wong wrote: > 2. Do we need to revalidate mappings for directio writes? I think the > answer is no (for xfs) because the ->iomap_begin call will allocate > whatever blocks are needed and truncate/punch/reflink block on the > iolock while the