dlm: always use GFP_NOFS
Replace all GFP_KERNEL and ls_allocation with GFP_NOFS. ls_allocation would be GFP_KERNEL for userland lockspaces and GFP_NOFS for file system lockspaces. It was discovered that any lockspaces on the system can affect all others by triggering memory reclaim in the file system which could in turn call back into the dlm to acquire locks, deadlocking dlm threads that were shared by all lockspaces, like dlm_recv. Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
@@ -2689,7 +2689,7 @@ static int _create_message(struct dlm_ls *ls, int mb_len,
|
||||
pass into lowcomms_commit and a message buffer (mb) that we
|
||||
write our data into */
|
||||
|
||||
mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb);
|
||||
mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb);
|
||||
if (!mh)
|
||||
return -ENOBUFS;
|
||||
|
||||
@@ -4512,7 +4512,7 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
|
||||
}
|
||||
|
||||
if (flags & DLM_LKF_VALBLK) {
|
||||
ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL);
|
||||
ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS);
|
||||
if (!ua->lksb.sb_lvbptr) {
|
||||
kfree(ua);
|
||||
__put_lkb(ls, lkb);
|
||||
@@ -4582,7 +4582,7 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
|
||||
ua = lkb->lkb_ua;
|
||||
|
||||
if (flags & DLM_LKF_VALBLK && !ua->lksb.sb_lvbptr) {
|
||||
ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL);
|
||||
ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS);
|
||||
if (!ua->lksb.sb_lvbptr) {
|
||||
error = -ENOMEM;
|
||||
goto out_put;
|
||||
|
Reference in New Issue
Block a user