Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
dlm: always use GFP_NOFS

+46 -53
+12 -12
fs/dlm/config.c
··· 410 struct dlm_comms *cms = NULL; 411 void *gps = NULL; 412 413 - cl = kzalloc(sizeof(struct dlm_cluster), GFP_KERNEL); 414 - gps = kcalloc(3, sizeof(struct config_group *), GFP_KERNEL); 415 - sps = kzalloc(sizeof(struct dlm_spaces), GFP_KERNEL); 416 - cms = kzalloc(sizeof(struct dlm_comms), GFP_KERNEL); 417 418 if (!cl || !gps || !sps || !cms) 419 goto fail; ··· 482 struct dlm_nodes *nds = NULL; 483 void *gps = NULL; 484 485 - sp = kzalloc(sizeof(struct dlm_space), GFP_KERNEL); 486 - gps = kcalloc(2, sizeof(struct config_group *), GFP_KERNEL); 487 - nds = kzalloc(sizeof(struct dlm_nodes), GFP_KERNEL); 488 489 if (!sp || !gps || !nds) 490 goto fail; ··· 536 { 537 struct dlm_comm *cm; 538 539 - cm = kzalloc(sizeof(struct dlm_comm), GFP_KERNEL); 540 if (!cm) 541 return ERR_PTR(-ENOMEM); 542 ··· 569 struct dlm_space *sp = config_item_to_space(g->cg_item.ci_parent); 570 struct dlm_node *nd; 571 572 - nd = kzalloc(sizeof(struct dlm_node), GFP_KERNEL); 573 if (!nd) 574 return ERR_PTR(-ENOMEM); 575 ··· 705 if (cm->addr_count >= DLM_MAX_ADDR_COUNT) 706 return -ENOSPC; 707 708 - addr = kzalloc(sizeof(*addr), GFP_KERNEL); 709 if (!addr) 710 return -ENOMEM; 711 ··· 868 869 ids_count = sp->members_count; 870 871 - ids = kcalloc(ids_count, sizeof(int), GFP_KERNEL); 872 if (!ids) { 873 rv = -ENOMEM; 874 goto out; ··· 886 if (!new_count) 887 goto out_ids; 888 889 - new = kcalloc(new_count, sizeof(int), GFP_KERNEL); 890 if (!new) { 891 kfree(ids); 892 rv = -ENOMEM;
··· 410 struct dlm_comms *cms = NULL; 411 void *gps = NULL; 412 413 + cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS); 414 + gps = kcalloc(3, sizeof(struct config_group *), GFP_NOFS); 415 + sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS); 416 + cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS); 417 418 if (!cl || !gps || !sps || !cms) 419 goto fail; ··· 482 struct dlm_nodes *nds = NULL; 483 void *gps = NULL; 484 485 + sp = kzalloc(sizeof(struct dlm_space), GFP_NOFS); 486 + gps = kcalloc(2, sizeof(struct config_group *), GFP_NOFS); 487 + nds = kzalloc(sizeof(struct dlm_nodes), GFP_NOFS); 488 489 if (!sp || !gps || !nds) 490 goto fail; ··· 536 { 537 struct dlm_comm *cm; 538 539 + cm = kzalloc(sizeof(struct dlm_comm), GFP_NOFS); 540 if (!cm) 541 return ERR_PTR(-ENOMEM); 542 ··· 569 struct dlm_space *sp = config_item_to_space(g->cg_item.ci_parent); 570 struct dlm_node *nd; 571 572 + nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS); 573 if (!nd) 574 return ERR_PTR(-ENOMEM); 575 ··· 705 if (cm->addr_count >= DLM_MAX_ADDR_COUNT) 706 return -ENOSPC; 707 708 + addr = kzalloc(sizeof(*addr), GFP_NOFS); 709 if (!addr) 710 return -ENOMEM; 711 ··· 868 869 ids_count = sp->members_count; 870 871 + ids = kcalloc(ids_count, sizeof(int), GFP_NOFS); 872 if (!ids) { 873 rv = -ENOMEM; 874 goto out; ··· 886 if (!new_count) 887 goto out_ids; 888 889 + new = kcalloc(new_count, sizeof(int), GFP_NOFS); 890 if (!new) { 891 kfree(ids); 892 rv = -ENOMEM;
+1 -1
fs/dlm/debug_fs.c
··· 404 if (bucket >= ls->ls_rsbtbl_size) 405 return NULL; 406 407 - ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_KERNEL); 408 if (!ri) 409 return NULL; 410 if (n == 0)
··· 404 if (bucket >= ls->ls_rsbtbl_size) 405 return NULL; 406 407 + ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_NOFS); 408 if (!ri) 409 return NULL; 410 if (n == 0)
+3 -4
fs/dlm/dir.c
··· 49 spin_unlock(&ls->ls_recover_list_lock); 50 51 if (!found) 52 - de = kzalloc(sizeof(struct dlm_direntry) + len, 53 - ls->ls_allocation); 54 return de; 55 } 56 ··· 211 212 dlm_dir_clear(ls); 213 214 - last_name = kmalloc(DLM_RESNAME_MAXLEN, ls->ls_allocation); 215 if (!last_name) 216 goto out; 217 ··· 322 if (namelen > DLM_RESNAME_MAXLEN) 323 return -EINVAL; 324 325 - de = kzalloc(sizeof(struct dlm_direntry) + namelen, ls->ls_allocation); 326 if (!de) 327 return -ENOMEM; 328
··· 49 spin_unlock(&ls->ls_recover_list_lock); 50 51 if (!found) 52 + de = kzalloc(sizeof(struct dlm_direntry) + len, GFP_NOFS); 53 return de; 54 } 55 ··· 212 213 dlm_dir_clear(ls); 214 215 + last_name = kmalloc(DLM_RESNAME_MAXLEN, GFP_NOFS); 216 if (!last_name) 217 goto out; 218 ··· 323 if (namelen > DLM_RESNAME_MAXLEN) 324 return -EINVAL; 325 326 + de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_NOFS); 327 if (!de) 328 return -ENOMEM; 329
-1
fs/dlm/dlm_internal.h
··· 473 int ls_low_nodeid; 474 int ls_total_weight; 475 int *ls_node_array; 476 - gfp_t ls_allocation; 477 478 struct dlm_rsb ls_stub_rsb; /* for returning errors */ 479 struct dlm_lkb ls_stub_lkb; /* for returning errors */
··· 473 int ls_low_nodeid; 474 int ls_total_weight; 475 int *ls_node_array; 476 477 struct dlm_rsb ls_stub_rsb; /* for returning errors */ 478 struct dlm_lkb ls_stub_lkb; /* for returning errors */
+3 -3
fs/dlm/lock.c
··· 2689 pass into lowcomms_commit and a message buffer (mb) that we 2690 write our data into */ 2691 2692 - mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb); 2693 if (!mh) 2694 return -ENOBUFS; 2695 ··· 4512 } 4513 4514 if (flags & DLM_LKF_VALBLK) { 4515 - ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL); 4516 if (!ua->lksb.sb_lvbptr) { 4517 kfree(ua); 4518 __put_lkb(ls, lkb); ··· 4582 ua = lkb->lkb_ua; 4583 4584 if (flags & DLM_LKF_VALBLK && !ua->lksb.sb_lvbptr) { 4585 - ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL); 4586 if (!ua->lksb.sb_lvbptr) { 4587 error = -ENOMEM; 4588 goto out_put;
··· 2689 pass into lowcomms_commit and a message buffer (mb) that we 2690 write our data into */ 2691 2692 + mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb); 2693 if (!mh) 2694 return -ENOBUFS; 2695 ··· 4512 } 4513 4514 if (flags & DLM_LKF_VALBLK) { 4515 + ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS); 4516 if (!ua->lksb.sb_lvbptr) { 4517 kfree(ua); 4518 __put_lkb(ls, lkb); ··· 4582 ua = lkb->lkb_ua; 4583 4584 if (flags & DLM_LKF_VALBLK && !ua->lksb.sb_lvbptr) { 4585 + ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS); 4586 if (!ua->lksb.sb_lvbptr) { 4587 error = -ENOMEM; 4588 goto out_put;
+5 -10
fs/dlm/lockspace.c
··· 430 431 error = -ENOMEM; 432 433 - ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL); 434 if (!ls) 435 goto out; 436 memcpy(ls->ls_name, name, namelen); ··· 443 if (flags & DLM_LSFL_TIMEWARN) 444 set_bit(LSFL_TIMEWARN, &ls->ls_flags); 445 446 - if (flags & DLM_LSFL_FS) 447 - ls->ls_allocation = GFP_NOFS; 448 - else 449 - ls->ls_allocation = GFP_KERNEL; 450 - 451 /* ls_exflags are forced to match among nodes, and we don't 452 need to require all nodes to have some flags set */ 453 ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS | ··· 451 size = dlm_config.ci_rsbtbl_size; 452 ls->ls_rsbtbl_size = size; 453 454 - ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_KERNEL); 455 if (!ls->ls_rsbtbl) 456 goto out_lsfree; 457 for (i = 0; i < size; i++) { ··· 463 size = dlm_config.ci_lkbtbl_size; 464 ls->ls_lkbtbl_size = size; 465 466 - ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_KERNEL); 467 if (!ls->ls_lkbtbl) 468 goto out_rsbfree; 469 for (i = 0; i < size; i++) { ··· 475 size = dlm_config.ci_dirtbl_size; 476 ls->ls_dirtbl_size = size; 477 478 - ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_KERNEL); 479 if (!ls->ls_dirtbl) 480 goto out_lkbfree; 481 for (i = 0; i < size; i++) { ··· 522 mutex_init(&ls->ls_requestqueue_mutex); 523 mutex_init(&ls->ls_clear_proc_locks); 524 525 - ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL); 526 if (!ls->ls_recover_buf) 527 goto out_dirfree; 528
··· 430 431 error = -ENOMEM; 432 433 + ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_NOFS); 434 if (!ls) 435 goto out; 436 memcpy(ls->ls_name, name, namelen); ··· 443 if (flags & DLM_LSFL_TIMEWARN) 444 set_bit(LSFL_TIMEWARN, &ls->ls_flags); 445 446 /* ls_exflags are forced to match among nodes, and we don't 447 need to require all nodes to have some flags set */ 448 ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS | ··· 456 size = dlm_config.ci_rsbtbl_size; 457 ls->ls_rsbtbl_size = size; 458 459 + ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_NOFS); 460 if (!ls->ls_rsbtbl) 461 goto out_lsfree; 462 for (i = 0; i < size; i++) { ··· 468 size = dlm_config.ci_lkbtbl_size; 469 ls->ls_lkbtbl_size = size; 470 471 + ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_NOFS); 472 if (!ls->ls_lkbtbl) 473 goto out_rsbfree; 474 for (i = 0; i < size; i++) { ··· 480 size = dlm_config.ci_dirtbl_size; 481 ls->ls_dirtbl_size = size; 482 483 + ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_NOFS); 484 if (!ls->ls_dirtbl) 485 goto out_lkbfree; 486 for (i = 0; i < size; i++) { ··· 527 mutex_init(&ls->ls_requestqueue_mutex); 528 mutex_init(&ls->ls_clear_proc_locks); 529 530 + ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_NOFS); 531 if (!ls->ls_recover_buf) 532 goto out_dirfree; 533
+3 -3
fs/dlm/lowcomms.c
··· 1060 if (dlm_our_addr(&sas, i)) 1061 break; 1062 1063 - addr = kmalloc(sizeof(*addr), GFP_KERNEL); 1064 if (!addr) 1065 break; 1066 memcpy(addr, &sas, sizeof(*addr)); ··· 1099 struct sockaddr_storage localaddr; 1100 struct sctp_event_subscribe subscribe; 1101 int result = -EINVAL, num = 1, i, addr_len; 1102 - struct connection *con = nodeid2con(0, GFP_KERNEL); 1103 int bufsize = NEEDED_RMEM; 1104 1105 if (!con) ··· 1171 static int tcp_listen_for_all(void) 1172 { 1173 struct socket *sock = NULL; 1174 - struct connection *con = nodeid2con(0, GFP_KERNEL); 1175 int result = -EINVAL; 1176 1177 if (!con)
··· 1060 if (dlm_our_addr(&sas, i)) 1061 break; 1062 1063 + addr = kmalloc(sizeof(*addr), GFP_NOFS); 1064 if (!addr) 1065 break; 1066 memcpy(addr, &sas, sizeof(*addr)); ··· 1099 struct sockaddr_storage localaddr; 1100 struct sctp_event_subscribe subscribe; 1101 int result = -EINVAL, num = 1, i, addr_len; 1102 + struct connection *con = nodeid2con(0, GFP_NOFS); 1103 int bufsize = NEEDED_RMEM; 1104 1105 if (!con) ··· 1171 static int tcp_listen_for_all(void) 1172 { 1173 struct socket *sock = NULL; 1174 + struct connection *con = nodeid2con(0, GFP_NOFS); 1175 int result = -EINVAL; 1176 1177 if (!con)
+4 -4
fs/dlm/member.c
··· 48 struct dlm_member *memb; 49 int w, error; 50 51 - memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); 52 if (!memb) 53 return -ENOMEM; 54 ··· 143 144 ls->ls_total_weight = total; 145 146 - array = kmalloc(sizeof(int) * total, ls->ls_allocation); 147 if (!array) 148 return; 149 ··· 226 continue; 227 log_debug(ls, "new nodeid %d is a re-added member", rv->new[i]); 228 229 - memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); 230 if (!memb) 231 return -ENOMEM; 232 memb->nodeid = rv->new[i]; ··· 341 int *ids = NULL, *new = NULL; 342 int error, ids_count = 0, new_count = 0; 343 344 - rv = kzalloc(sizeof(struct dlm_recover), ls->ls_allocation); 345 if (!rv) 346 return -ENOMEM; 347
··· 48 struct dlm_member *memb; 49 int w, error; 50 51 + memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS); 52 if (!memb) 53 return -ENOMEM; 54 ··· 143 144 ls->ls_total_weight = total; 145 146 + array = kmalloc(sizeof(int) * total, GFP_NOFS); 147 if (!array) 148 return; 149 ··· 226 continue; 227 log_debug(ls, "new nodeid %d is a re-added member", rv->new[i]); 228 229 + memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS); 230 if (!memb) 231 return -ENOMEM; 232 memb->nodeid = rv->new[i]; ··· 341 int *ids = NULL, *new = NULL; 342 int error, ids_count = 0, new_count = 0; 343 344 + rv = kzalloc(sizeof(struct dlm_recover), GFP_NOFS); 345 if (!rv) 346 return -ENOMEM; 347
+3 -3
fs/dlm/memory.c
··· 39 { 40 char *p; 41 42 - p = kzalloc(ls->ls_lvblen, ls->ls_allocation); 43 return p; 44 } 45 ··· 57 58 DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,); 59 60 - r = kzalloc(sizeof(*r) + namelen, ls->ls_allocation); 61 return r; 62 } 63 ··· 72 { 73 struct dlm_lkb *lkb; 74 75 - lkb = kmem_cache_zalloc(lkb_cache, ls->ls_allocation); 76 return lkb; 77 } 78
··· 39 { 40 char *p; 41 42 + p = kzalloc(ls->ls_lvblen, GFP_NOFS); 43 return p; 44 } 45 ··· 57 58 DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,); 59 60 + r = kzalloc(sizeof(*r) + namelen, GFP_NOFS); 61 return r; 62 } 63 ··· 72 { 73 struct dlm_lkb *lkb; 74 75 + lkb = kmem_cache_zalloc(lkb_cache, GFP_NOFS); 76 return lkb; 77 } 78
+1 -1
fs/dlm/netlink.c
··· 26 struct sk_buff *skb; 27 void *data; 28 29 - skb = genlmsg_new(size, GFP_KERNEL); 30 if (!skb) 31 return -ENOMEM; 32
··· 26 struct sk_buff *skb; 27 void *data; 28 29 + skb = genlmsg_new(size, GFP_NOFS); 30 if (!skb) 31 return -ENOMEM; 32
+3 -3
fs/dlm/plock.c
··· 82 if (!ls) 83 return -EINVAL; 84 85 - xop = kzalloc(sizeof(*xop), GFP_KERNEL); 86 if (!xop) { 87 rv = -ENOMEM; 88 goto out; ··· 211 if (!ls) 212 return -EINVAL; 213 214 - op = kzalloc(sizeof(*op), GFP_KERNEL); 215 if (!op) { 216 rv = -ENOMEM; 217 goto out; ··· 266 if (!ls) 267 return -EINVAL; 268 269 - op = kzalloc(sizeof(*op), GFP_KERNEL); 270 if (!op) { 271 rv = -ENOMEM; 272 goto out;
··· 82 if (!ls) 83 return -EINVAL; 84 85 + xop = kzalloc(sizeof(*xop), GFP_NOFS); 86 if (!xop) { 87 rv = -ENOMEM; 88 goto out; ··· 211 if (!ls) 212 return -EINVAL; 213 214 + op = kzalloc(sizeof(*op), GFP_NOFS); 215 if (!op) { 216 rv = -ENOMEM; 217 goto out; ··· 266 if (!ls) 267 return -EINVAL; 268 269 + op = kzalloc(sizeof(*op), GFP_NOFS); 270 if (!op) { 271 rv = -ENOMEM; 272 goto out;
+1 -1
fs/dlm/rcom.c
··· 38 char *mb; 39 int mb_len = sizeof(struct dlm_rcom) + len; 40 41 - mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb); 42 if (!mh) { 43 log_print("create_rcom to %d type %d len %d ENOBUFS", 44 to_nodeid, type, len);
··· 38 char *mb; 39 int mb_len = sizeof(struct dlm_rcom) + len; 40 41 + mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb); 42 if (!mh) { 43 log_print("create_rcom to %d type %d len %d ENOBUFS", 44 to_nodeid, type, len);
+1 -1
fs/dlm/requestqueue.c
··· 35 struct rq_entry *e; 36 int length = ms->m_header.h_length - sizeof(struct dlm_message); 37 38 - e = kmalloc(sizeof(struct rq_entry) + length, ls->ls_allocation); 39 if (!e) { 40 log_print("dlm_add_requestqueue: out of memory len %d", length); 41 return;
··· 35 struct rq_entry *e; 36 int length = ms->m_header.h_length - sizeof(struct dlm_message); 37 38 + e = kmalloc(sizeof(struct rq_entry) + length, GFP_NOFS); 39 if (!e) { 40 log_print("dlm_add_requestqueue: out of memory len %d", length); 41 return;
+6 -6
fs/dlm/user.c
··· 267 goto out; 268 } 269 270 - ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 271 if (!ua) 272 goto out; 273 ua->proc = proc; ··· 307 if (!ls) 308 return -ENOENT; 309 310 - ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 311 if (!ua) 312 goto out; 313 ua->proc = proc; ··· 352 353 error = -ENOMEM; 354 len = strlen(name) + strlen(name_prefix) + 2; 355 - ls->ls_device.name = kzalloc(len, GFP_KERNEL); 356 if (!ls->ls_device.name) 357 goto fail; 358 ··· 520 #endif 521 return -EINVAL; 522 523 - kbuf = kzalloc(count + 1, GFP_KERNEL); 524 if (!kbuf) 525 return -ENOMEM; 526 ··· 546 547 /* add 1 after namelen so that the name string is terminated */ 548 kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1, 549 - GFP_KERNEL); 550 if (!kbuf) { 551 kfree(k32buf); 552 return -ENOMEM; ··· 648 if (!ls) 649 return -ENOENT; 650 651 - proc = kzalloc(sizeof(struct dlm_user_proc), GFP_KERNEL); 652 if (!proc) { 653 dlm_put_lockspace(ls); 654 return -ENOMEM;
··· 267 goto out; 268 } 269 270 + ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); 271 if (!ua) 272 goto out; 273 ua->proc = proc; ··· 307 if (!ls) 308 return -ENOENT; 309 310 + ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); 311 if (!ua) 312 goto out; 313 ua->proc = proc; ··· 352 353 error = -ENOMEM; 354 len = strlen(name) + strlen(name_prefix) + 2; 355 + ls->ls_device.name = kzalloc(len, GFP_NOFS); 356 if (!ls->ls_device.name) 357 goto fail; 358 ··· 520 #endif 521 return -EINVAL; 522 523 + kbuf = kzalloc(count + 1, GFP_NOFS); 524 if (!kbuf) 525 return -ENOMEM; 526 ··· 546 547 /* add 1 after namelen so that the name string is terminated */ 548 kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1, 549 + GFP_NOFS); 550 if (!kbuf) { 551 kfree(k32buf); 552 return -ENOMEM; ··· 648 if (!ls) 649 return -ENOENT; 650 651 + proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS); 652 if (!proc) { 653 dlm_put_lockspace(ls); 654 return -ENOMEM;