Commit d6d7b702 authored by Steven Whitehouse's avatar Steven Whitehouse Committed by David Teigland

dlm: fix up memory allocation flags

Use ls_allocation for memory allocations, which a cluster fs sets to
GFP_NOFS.  Use GFP_NOFS for allocations when no lockspace struct is
available.  Taking dlm locks needs to avoid calling back into the
cluster fs because write-out can require taking dlm locks.

Cc: Christine Caulfield <ccaulfie@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 58e20d8d
...@@ -295,6 +295,7 @@ static int add_sock(struct socket *sock, struct connection *con) ...@@ -295,6 +295,7 @@ static int add_sock(struct socket *sock, struct connection *con)
con->sock->sk->sk_write_space = lowcomms_write_space; con->sock->sk->sk_write_space = lowcomms_write_space;
con->sock->sk->sk_state_change = lowcomms_state_change; con->sock->sk->sk_state_change = lowcomms_state_change;
con->sock->sk->sk_user_data = con; con->sock->sk->sk_user_data = con;
con->sock->sk->sk_allocation = GFP_NOFS;
return 0; return 0;
} }
......
...@@ -39,7 +39,7 @@ char *dlm_allocate_lvb(struct dlm_ls *ls) ...@@ -39,7 +39,7 @@ char *dlm_allocate_lvb(struct dlm_ls *ls)
{ {
char *p; char *p;
p = kzalloc(ls->ls_lvblen, GFP_KERNEL); p = kzalloc(ls->ls_lvblen, ls->ls_allocation);
return p; return p;
} }
...@@ -57,7 +57,7 @@ struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls, int namelen) ...@@ -57,7 +57,7 @@ struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls, int namelen)
DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,); DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,);
r = kzalloc(sizeof(*r) + namelen, GFP_KERNEL); r = kzalloc(sizeof(*r) + namelen, ls->ls_allocation);
return r; return r;
} }
...@@ -72,7 +72,7 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls) ...@@ -72,7 +72,7 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls)
{ {
struct dlm_lkb *lkb; struct dlm_lkb *lkb;
lkb = kmem_cache_zalloc(lkb_cache, GFP_KERNEL); lkb = kmem_cache_zalloc(lkb_cache, ls->ls_allocation);
return lkb; return lkb;
} }
......
...@@ -112,7 +112,7 @@ int dlm_process_incoming_buffer(int nodeid, const void *base, ...@@ -112,7 +112,7 @@ int dlm_process_incoming_buffer(int nodeid, const void *base,
ordinary messages). */ ordinary messages). */
if (msglen > sizeof(__tmp) && p == &__tmp.p) { if (msglen > sizeof(__tmp) && p == &__tmp.p) {
p = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL); p = kmalloc(dlm_config.ci_buffer_size, GFP_NOFS);
if (p == NULL) if (p == NULL)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment