Skip to content

Commit faa48b2

Browse files
bcodding-rhgregkh
authored andcommitted
SUNRPC: Set memalloc_nofs_save() for sync tasks
[ Upstream commit f0940f4 ] We could recurse into NFS doing memory reclaim while sending a sync task, which might result in a deadlock. Set memalloc_nofs_save for sync task execution. Fixes: a1231fd ("SUNRPC: Set memalloc_nofs_save() on all rpciod/xprtiod jobs") Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 475a430 commit faa48b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/sunrpc/sched.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,11 @@ void rpc_execute(struct rpc_task *task)
963963

964964
rpc_set_active(task);
965965
rpc_make_runnable(rpciod_workqueue, task);
966-
if (!is_async)
966+
if (!is_async) {
967+
unsigned int pflags = memalloc_nofs_save();
967968
__rpc_execute(task);
969+
memalloc_nofs_restore(pflags);
970+
}
968971
}
969972

970973
static void rpc_async_schedule(struct work_struct *work)

0 commit comments

Comments
 (0)