Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5a69ed7 authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Greg Kroah-Hartman
Browse files

SUNRPC: Set memalloc_nofs_save() for sync tasks



[ Upstream commit f0940f4b3284a00f38a5d42e6067c2aaa20e1f2e ]

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: a1231fda ("SUNRPC: Set memalloc_nofs_save() on all rpciod/xprtiod jobs")
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9c9ea7ac
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -990,8 +990,11 @@ void rpc_execute(struct rpc_task *task)

	rpc_set_active(task);
	rpc_make_runnable(rpciod_workqueue, task);
	if (!is_async)
	if (!is_async) {
		unsigned int pflags = memalloc_nofs_save();
		__rpc_execute(task);
		memalloc_nofs_restore(pflags);
	}
}

static void rpc_async_schedule(struct work_struct *work)