Skip to content

Commit 92764e8

Browse files
dhowellsbrauner
authored andcommitted
netfs, ceph: Partially revert "netfs: Replace PG_fscache by setting folio->private and marking dirty"
This partially reverts commit 2ff1e97. In addition to reverting the removal of PG_private_2 wrangling from the buffered read code[1][2], the removal of the waits for PG_private_2 from netfs_release_folio() and netfs_invalidate_folio() need reverting too. It also adds a wait into ceph_evict_inode() to wait for netfs read and copy-to-cache ops to complete. Fixes: 2ff1e97 ("netfs: Replace PG_fscache by setting folio->private and marking dirty") Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/3575457.1722355300@warthog.procyon.org.uk [1] Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e5ced7804cb9184c4a23f8054551240562a8eda [2] Link: https://lore.kernel.org/r/20240814203850.2240469-2-dhowells@redhat.com cc: Max Kellermann <max.kellermann@ionos.com> cc: Ilya Dryomov <idryomov@gmail.com> cc: Xiubo Li <xiubli@redhat.com> cc: Jeff Layton <jlayton@kernel.org> cc: Matthew Wilcox <willy@infradead.org> cc: ceph-devel@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 47ac09b commit 92764e8

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

fs/ceph/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ void ceph_evict_inode(struct inode *inode)
695695

696696
percpu_counter_dec(&mdsc->metric.total_inodes);
697697

698+
netfs_wait_for_outstanding_io(inode);
698699
truncate_inode_pages_final(&inode->i_data);
699700
if (inode->i_state & I_PINNING_NETFS_WB)
700701
ceph_fscache_unuse_cookie(inode, true);

fs/netfs/misc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)
101101

102102
_enter("{%lx},%zx,%zx", folio->index, offset, length);
103103

104+
folio_wait_private_2(folio); /* [DEPRECATED] */
105+
104106
if (!folio_test_private(folio))
105107
return;
106108

@@ -165,6 +167,11 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
165167

166168
if (folio_test_private(folio))
167169
return false;
170+
if (unlikely(folio_test_private_2(folio))) { /* [DEPRECATED] */
171+
if (current_is_kswapd() || !(gfp & __GFP_FS))
172+
return false;
173+
folio_wait_private_2(folio);
174+
}
168175
fscache_note_page_release(netfs_i_cookie(ctx));
169176
return true;
170177
}

0 commit comments

Comments
 (0)