Commit ad8100e0 authored by Kurt Hackel's avatar Kurt Hackel Committed by Mark Fasheh

ocfs2: use GFP_NOFS in some dlm operations

Signed-off-by: default avatarKurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent b7084ab5
...@@ -116,7 +116,7 @@ static int dlmfs_file_open(struct inode *inode, ...@@ -116,7 +116,7 @@ static int dlmfs_file_open(struct inode *inode,
* doesn't make sense for LVB writes. */ * doesn't make sense for LVB writes. */
file->f_flags &= ~O_APPEND; file->f_flags &= ~O_APPEND;
fp = kmalloc(sizeof(*fp), GFP_KERNEL); fp = kmalloc(sizeof(*fp), GFP_NOFS);
if (!fp) { if (!fp) {
status = -ENOMEM; status = -ENOMEM;
goto bail; goto bail;
...@@ -196,7 +196,7 @@ static ssize_t dlmfs_file_read(struct file *filp, ...@@ -196,7 +196,7 @@ static ssize_t dlmfs_file_read(struct file *filp,
else else
readlen = count - *ppos; readlen = count - *ppos;
lvb_buf = kmalloc(readlen, GFP_KERNEL); lvb_buf = kmalloc(readlen, GFP_NOFS);
if (!lvb_buf) if (!lvb_buf)
return -ENOMEM; return -ENOMEM;
...@@ -240,7 +240,7 @@ static ssize_t dlmfs_file_write(struct file *filp, ...@@ -240,7 +240,7 @@ static ssize_t dlmfs_file_write(struct file *filp,
else else
writelen = count - *ppos; writelen = count - *ppos;
lvb_buf = kmalloc(writelen, GFP_KERNEL); lvb_buf = kmalloc(writelen, GFP_NOFS);
if (!lvb_buf) if (!lvb_buf)
return -ENOMEM; return -ENOMEM;
......
...@@ -408,13 +408,13 @@ struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie, ...@@ -408,13 +408,13 @@ struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie,
struct dlm_lock *lock; struct dlm_lock *lock;
int kernel_allocated = 0; int kernel_allocated = 0;
lock = kcalloc(1, sizeof(*lock), GFP_KERNEL); lock = kcalloc(1, sizeof(*lock), GFP_NOFS);
if (!lock) if (!lock)
return NULL; return NULL;
if (!lksb) { if (!lksb) {
/* zero memory only if kernel-allocated */ /* zero memory only if kernel-allocated */
lksb = kcalloc(1, sizeof(*lksb), GFP_KERNEL); lksb = kcalloc(1, sizeof(*lksb), GFP_NOFS);
if (!lksb) { if (!lksb) {
kfree(lock); kfree(lock);
return NULL; return NULL;
......
...@@ -709,11 +709,11 @@ struct dlm_lock_resource *dlm_new_lockres(struct dlm_ctxt *dlm, ...@@ -709,11 +709,11 @@ struct dlm_lock_resource *dlm_new_lockres(struct dlm_ctxt *dlm,
{ {
struct dlm_lock_resource *res; struct dlm_lock_resource *res;
res = kmalloc(sizeof(struct dlm_lock_resource), GFP_KERNEL); res = kmalloc(sizeof(struct dlm_lock_resource), GFP_NOFS);
if (!res) if (!res)
return NULL; return NULL;
res->lockname.name = kmalloc(namelen, GFP_KERNEL); res->lockname.name = kmalloc(namelen, GFP_NOFS);
if (!res->lockname.name) { if (!res->lockname.name) {
kfree(res); kfree(res);
return NULL; return NULL;
...@@ -777,7 +777,7 @@ lookup: ...@@ -777,7 +777,7 @@ lookup:
mlog(0, "allocating a new resource\n"); mlog(0, "allocating a new resource\n");
/* nothing found and we need to allocate one. */ /* nothing found and we need to allocate one. */
alloc_mle = (struct dlm_master_list_entry *) alloc_mle = (struct dlm_master_list_entry *)
kmem_cache_alloc(dlm_mle_cache, GFP_KERNEL); kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!alloc_mle) if (!alloc_mle)
goto leave; goto leave;
res = dlm_new_lockres(dlm, lockid, namelen); res = dlm_new_lockres(dlm, lockid, namelen);
...@@ -1532,7 +1532,7 @@ way_up_top: ...@@ -1532,7 +1532,7 @@ way_up_top:
spin_unlock(&dlm->spinlock); spin_unlock(&dlm->spinlock);
mle = (struct dlm_master_list_entry *) mle = (struct dlm_master_list_entry *)
kmem_cache_alloc(dlm_mle_cache, GFP_KERNEL); kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!mle) { if (!mle) {
response = DLM_MASTER_RESP_ERROR; response = DLM_MASTER_RESP_ERROR;
mlog_errno(-ENOMEM); mlog_errno(-ENOMEM);
...@@ -1940,7 +1940,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, ...@@ -1940,7 +1940,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
int ignore_higher, u8 request_from, u32 flags) int ignore_higher, u8 request_from, u32 flags)
{ {
struct dlm_work_item *item; struct dlm_work_item *item;
item = kcalloc(1, sizeof(*item), GFP_KERNEL); item = kcalloc(1, sizeof(*item), GFP_NOFS);
if (!item) if (!item)
return -ENOMEM; return -ENOMEM;
...@@ -2175,14 +2175,14 @@ int dlm_migrate_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -2175,14 +2175,14 @@ int dlm_migrate_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
*/ */
ret = -ENOMEM; ret = -ENOMEM;
mres = (struct dlm_migratable_lockres *) __get_free_page(GFP_KERNEL); mres = (struct dlm_migratable_lockres *) __get_free_page(GFP_NOFS);
if (!mres) { if (!mres) {
mlog_errno(ret); mlog_errno(ret);
goto leave; goto leave;
} }
mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache, mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
GFP_KERNEL); GFP_NOFS);
if (!mle) { if (!mle) {
mlog_errno(ret); mlog_errno(ret);
goto leave; goto leave;
...@@ -2639,7 +2639,7 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -2639,7 +2639,7 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data)
/* preallocate.. if this fails, abort */ /* preallocate.. if this fails, abort */
mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache, mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
GFP_KERNEL); GFP_NOFS);
if (!mle) { if (!mle) {
ret = -ENOMEM; ret = -ENOMEM;
......
...@@ -737,7 +737,7 @@ static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node) ...@@ -737,7 +737,7 @@ static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
} }
BUG_ON(num == dead_node); BUG_ON(num == dead_node);
ndata = kcalloc(1, sizeof(*ndata), GFP_KERNEL); ndata = kcalloc(1, sizeof(*ndata), GFP_NOFS);
if (!ndata) { if (!ndata) {
dlm_destroy_recovery_area(dlm, dead_node); dlm_destroy_recovery_area(dlm, dead_node);
return -ENOMEM; return -ENOMEM;
...@@ -822,14 +822,14 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -822,14 +822,14 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data)
} }
BUG_ON(lr->dead_node != dlm->reco.dead_node); BUG_ON(lr->dead_node != dlm->reco.dead_node);
item = kcalloc(1, sizeof(*item), GFP_KERNEL); item = kcalloc(1, sizeof(*item), GFP_NOFS);
if (!item) { if (!item) {
dlm_put(dlm); dlm_put(dlm);
return -ENOMEM; return -ENOMEM;
} }
/* this will get freed by dlm_request_all_locks_worker */ /* this will get freed by dlm_request_all_locks_worker */
buf = (char *) __get_free_page(GFP_KERNEL); buf = (char *) __get_free_page(GFP_NOFS);
if (!buf) { if (!buf) {
kfree(item); kfree(item);
dlm_put(dlm); dlm_put(dlm);
...@@ -1302,8 +1302,8 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -1302,8 +1302,8 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data)
mlog(0, "all done flag. all lockres data received!\n"); mlog(0, "all done flag. all lockres data received!\n");
ret = -ENOMEM; ret = -ENOMEM;
buf = kmalloc(be16_to_cpu(msg->data_len), GFP_KERNEL); buf = kmalloc(be16_to_cpu(msg->data_len), GFP_NOFS);
item = kcalloc(1, sizeof(*item), GFP_KERNEL); item = kcalloc(1, sizeof(*item), GFP_NOFS);
if (!buf || !item) if (!buf || !item)
goto leave; goto leave;
......
...@@ -672,7 +672,7 @@ struct dlm_ctxt *user_dlm_register_context(struct qstr *name) ...@@ -672,7 +672,7 @@ struct dlm_ctxt *user_dlm_register_context(struct qstr *name)
u32 dlm_key; u32 dlm_key;
char *domain; char *domain;
domain = kmalloc(name->len + 1, GFP_KERNEL); domain = kmalloc(name->len + 1, GFP_NOFS);
if (!domain) { if (!domain) {
mlog_errno(-ENOMEM); mlog_errno(-ENOMEM);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
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