On Thu, Jun 04, 2020 at 03:05:47AM -0400, Yafang Shao wrote: > Recently there is a XFS deadlock on our server with an old kernel. > This deadlock is caused by allocating memory in xfs_map_blocks() while > doing writeback on behalf of memroy reclaim. Although this deadlock happens > on an old kernel, I think it could happen on the upstream as well. This > issue only happens once and can't be reproduced, so I haven't tried to > reproduce it on upsteam kernel. The report looks sensible, but I don't think the iomap code is the right place for this. Until/unless the VM people agree that ->writepages(s) generally should not recurse into the fs I think the low-level file system allocating is the right place, so xfs_map_blocks would seem like the correct place.