These two patches fix GFP flag issues in the filesystem I/O paths
discovered while reviewing Max Kellermann's "ceph: avoid fs reclaim
while using current->journal_info" fix.
The first patch is a real fix: ceph_alloc_cap_flush() is called from
ceph_writepages_start() inside the writeback layer, but uses GFP_KERNEL.
Direct reclaim triggered by this allocation can re-enter the writeback
path via the shrinker, causing recursive writeback and potential stack
overflow. Fix it to use GFP_NOFS, consistent with other allocations in
the same writepages path.
The second patch is a cleanup: __ceph_pool_perm_get() had three
allocations using GFP_NOFS and one using GFP_KERNEL, despite the
function only being called from user I/O paths where GFP_NOFS is
unnecessary. Use GFP_KERNEL consistently.
---
Xiubo Li (2):
ceph: use GFP_NOFS for cap flush allocation in writeback path
ceph: use GFP_KERNEL consistently in __ceph_pool_perm_get()
fs/ceph/addr.c | 6 +++---
fs/ceph/caps.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: 0b79edbeed72d6c75987b5b402edeafceb4d080d
change-id: 20260723-b4-gfp_nofs-ea6d112a2570
Best regards,
--
Xiubo Li <xiubo.li@clyso.com>