member.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /******************************************************************************
  2. *******************************************************************************
  3. **
  4. ** Copyright (C) 2005-2011 Red Hat, Inc. All rights reserved.
  5. **
  6. ** This copyrighted material is made available to anyone wishing to use,
  7. ** modify, copy, or redistribute it subject to the terms and conditions
  8. ** of the GNU General Public License v.2.
  9. **
  10. *******************************************************************************
  11. ******************************************************************************/
  12. #include "dlm_internal.h"
  13. #include "lockspace.h"
  14. #include "member.h"
  15. #include "recoverd.h"
  16. #include "recover.h"
  17. #include "rcom.h"
  18. #include "config.h"
  19. #include "lowcomms.h"
  20. int dlm_slots_version(struct dlm_header *h)
  21. {
  22. if ((h->h_version & 0x0000FFFF) < DLM_HEADER_SLOTS)
  23. return 0;
  24. return 1;
  25. }
  26. void dlm_slot_save(struct dlm_ls *ls, struct dlm_rcom *rc,
  27. struct dlm_member *memb)
  28. {
  29. struct rcom_config *rf = (struct rcom_config *)rc->rc_buf;
  30. if (!dlm_slots_version(&rc->rc_header))
  31. return;
  32. memb->slot = le16_to_cpu(rf->rf_our_slot);
  33. memb->generation = le32_to_cpu(rf->rf_generation);
  34. }
  35. void dlm_slots_copy_out(struct dlm_ls *ls, struct dlm_rcom *rc)
  36. {
  37. struct dlm_slot *slot;
  38. struct rcom_slot *ro;
  39. int i;
  40. ro = (struct rcom_slot *)(rc->rc_buf + sizeof(struct rcom_config));
  41. /* ls_slots array is sparse, but not rcom_slots */
  42. for (i = 0; i < ls->ls_slots_size; i++) {
  43. slot = &ls->ls_slots[i];
  44. if (!slot->nodeid)
  45. continue;
  46. ro->ro_nodeid = cpu_to_le32(slot->nodeid);
  47. ro->ro_slot = cpu_to_le16(slot->slot);
  48. ro++;
  49. }
  50. }
  51. #define SLOT_DEBUG_LINE 128
  52. static void log_slots(struct dlm_ls *ls, uint32_t gen, int num_slots,
  53. struct rcom_slot *ro0, struct dlm_slot *array,
  54. int array_size)
  55. {
  56. char line[SLOT_DEBUG_LINE];
  57. int len = SLOT_DEBUG_LINE - 1;
  58. int pos = 0;
  59. int ret, i;
  60. memset(line, 0, sizeof(line));
  61. if (array) {
  62. for (i = 0; i < array_size; i++) {
  63. if (!array[i].nodeid)
  64. continue;
  65. ret = snprintf(line + pos, len - pos, " %d:%d",
  66. array[i].slot, array[i].nodeid);
  67. if (ret >= len - pos)
  68. break;
  69. pos += ret;
  70. }
  71. } else if (ro0) {
  72. for (i = 0; i < num_slots; i++) {
  73. ret = snprintf(line + pos, len - pos, " %d:%d",
  74. ro0[i].ro_slot, ro0[i].ro_nodeid);
  75. if (ret >= len - pos)
  76. break;
  77. pos += ret;
  78. }
  79. }
  80. log_rinfo(ls, "generation %u slots %d%s", gen, num_slots, line);
  81. }
  82. int dlm_slots_copy_in(struct dlm_ls *ls)
  83. {
  84. struct dlm_member *memb;
  85. struct dlm_rcom *rc = ls->ls_recover_buf;
  86. struct rcom_config *rf = (struct rcom_config *)rc->rc_buf;
  87. struct rcom_slot *ro0, *ro;
  88. int our_nodeid = dlm_our_nodeid();
  89. int i, num_slots;
  90. uint32_t gen;
  91. if (!dlm_slots_version(&rc->rc_header))
  92. return -1;
  93. gen = le32_to_cpu(rf->rf_generation);
  94. if (gen <= ls->ls_generation) {
  95. log_error(ls, "dlm_slots_copy_in gen %u old %u",
  96. gen, ls->ls_generation);
  97. }
  98. ls->ls_generation = gen;
  99. num_slots = le16_to_cpu(rf->rf_num_slots);
  100. if (!num_slots)
  101. return -1;
  102. ro0 = (struct rcom_slot *)(rc->rc_buf + sizeof(struct rcom_config));
  103. for (i = 0, ro = ro0; i < num_slots; i++, ro++) {
  104. ro->ro_nodeid = le32_to_cpu(ro->ro_nodeid);
  105. ro->ro_slot = le16_to_cpu(ro->ro_slot);
  106. }
  107. log_slots(ls, gen, num_slots, ro0, NULL, 0);
  108. list_for_each_entry(memb, &ls->ls_nodes, list) {
  109. for (i = 0, ro = ro0; i < num_slots; i++, ro++) {
  110. if (ro->ro_nodeid != memb->nodeid)
  111. continue;
  112. memb->slot = ro->ro_slot;
  113. memb->slot_prev = memb->slot;
  114. break;
  115. }
  116. if (memb->nodeid == our_nodeid) {
  117. if (ls->ls_slot && ls->ls_slot != memb->slot) {
  118. log_error(ls, "dlm_slots_copy_in our slot "
  119. "changed %d %d", ls->ls_slot,
  120. memb->slot);
  121. return -1;
  122. }
  123. if (!ls->ls_slot)
  124. ls->ls_slot = memb->slot;
  125. }
  126. if (!memb->slot) {
  127. log_error(ls, "dlm_slots_copy_in nodeid %d no slot",
  128. memb->nodeid);
  129. return -1;
  130. }
  131. }
  132. return 0;
  133. }
  134. /* for any nodes that do not support slots, we will not have set memb->slot
  135. in wait_status_all(), so memb->slot will remain -1, and we will not
  136. assign slots or set ls_num_slots here */
  137. int dlm_slots_assign(struct dlm_ls *ls, int *num_slots, int *slots_size,
  138. struct dlm_slot **slots_out, uint32_t *gen_out)
  139. {
  140. struct dlm_member *memb;
  141. struct dlm_slot *array;
  142. int our_nodeid = dlm_our_nodeid();
  143. int array_size, max_slots, i;
  144. int need = 0;
  145. int max = 0;
  146. int num = 0;
  147. uint32_t gen = 0;
  148. /* our own memb struct will have slot -1 gen 0 */
  149. list_for_each_entry(memb, &ls->ls_nodes, list) {
  150. if (memb->nodeid == our_nodeid) {
  151. memb->slot = ls->ls_slot;
  152. memb->generation = ls->ls_generation;
  153. break;
  154. }
  155. }
  156. list_for_each_entry(memb, &ls->ls_nodes, list) {
  157. if (memb->generation > gen)
  158. gen = memb->generation;
  159. /* node doesn't support slots */
  160. if (memb->slot == -1)
  161. return -1;
  162. /* node needs a slot assigned */
  163. if (!memb->slot)
  164. need++;
  165. /* node has a slot assigned */
  166. num++;
  167. if (!max || max < memb->slot)
  168. max = memb->slot;
  169. /* sanity check, once slot is assigned it shouldn't change */
  170. if (memb->slot_prev && memb->slot && memb->slot_prev != memb->slot) {
  171. log_error(ls, "nodeid %d slot changed %d %d",
  172. memb->nodeid, memb->slot_prev, memb->slot);
  173. return -1;
  174. }
  175. memb->slot_prev = memb->slot;
  176. }
  177. array_size = max + need;
  178. array = kzalloc(array_size * sizeof(struct dlm_slot), GFP_NOFS);
  179. if (!array)
  180. return -ENOMEM;
  181. num = 0;
  182. /* fill in slots (offsets) that are used */
  183. list_for_each_entry(memb, &ls->ls_nodes, list) {
  184. if (!memb->slot)
  185. continue;
  186. if (memb->slot > array_size) {
  187. log_error(ls, "invalid slot number %d", memb->slot);
  188. kfree(array);
  189. return -1;
  190. }
  191. array[memb->slot - 1].nodeid = memb->nodeid;
  192. array[memb->slot - 1].slot = memb->slot;
  193. num++;
  194. }
  195. /* assign new slots from unused offsets */
  196. list_for_each_entry(memb, &ls->ls_nodes, list) {
  197. if (memb->slot)
  198. continue;
  199. for (i = 0; i < array_size; i++) {
  200. if (array[i].nodeid)
  201. continue;
  202. memb->slot = i + 1;
  203. memb->slot_prev = memb->slot;
  204. array[i].nodeid = memb->nodeid;
  205. array[i].slot = memb->slot;
  206. num++;
  207. if (!ls->ls_slot && memb->nodeid == our_nodeid)
  208. ls->ls_slot = memb->slot;
  209. break;
  210. }
  211. if (!memb->slot) {
  212. log_error(ls, "no free slot found");
  213. kfree(array);
  214. return -1;
  215. }
  216. }
  217. gen++;
  218. log_slots(ls, gen, num, NULL, array, array_size);
  219. max_slots = (dlm_config.ci_buffer_size - sizeof(struct dlm_rcom) -
  220. sizeof(struct rcom_config)) / sizeof(struct rcom_slot);
  221. if (num > max_slots) {
  222. log_error(ls, "num_slots %d exceeds max_slots %d",
  223. num, max_slots);
  224. kfree(array);
  225. return -1;
  226. }
  227. *gen_out = gen;
  228. *slots_out = array;
  229. *slots_size = array_size;
  230. *num_slots = num;
  231. return 0;
  232. }
  233. static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new)
  234. {
  235. struct dlm_member *memb = NULL;
  236. struct list_head *tmp;
  237. struct list_head *newlist = &new->list;
  238. struct list_head *head = &ls->ls_nodes;
  239. list_for_each(tmp, head) {
  240. memb = list_entry(tmp, struct dlm_member, list);
  241. if (new->nodeid < memb->nodeid)
  242. break;
  243. }
  244. if (!memb)
  245. list_add_tail(newlist, head);
  246. else {
  247. /* FIXME: can use list macro here */
  248. newlist->prev = tmp->prev;
  249. newlist->next = tmp;
  250. tmp->prev->next = newlist;
  251. tmp->prev = newlist;
  252. }
  253. }
  254. static int dlm_add_member(struct dlm_ls *ls, struct dlm_config_node *node)
  255. {
  256. struct dlm_member *memb;
  257. int error;
  258. memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS);
  259. if (!memb)
  260. return -ENOMEM;
  261. error = dlm_lowcomms_connect_node(node->nodeid);
  262. if (error < 0) {
  263. kfree(memb);
  264. return error;
  265. }
  266. memb->nodeid = node->nodeid;
  267. memb->weight = node->weight;
  268. memb->comm_seq = node->comm_seq;
  269. add_ordered_member(ls, memb);
  270. ls->ls_num_nodes++;
  271. return 0;
  272. }
  273. static struct dlm_member *find_memb(struct list_head *head, int nodeid)
  274. {
  275. struct dlm_member *memb;
  276. list_for_each_entry(memb, head, list) {
  277. if (memb->nodeid == nodeid)
  278. return memb;
  279. }
  280. return NULL;
  281. }
  282. int dlm_is_member(struct dlm_ls *ls, int nodeid)
  283. {
  284. if (find_memb(&ls->ls_nodes, nodeid))
  285. return 1;
  286. return 0;
  287. }
  288. int dlm_is_removed(struct dlm_ls *ls, int nodeid)
  289. {
  290. if (find_memb(&ls->ls_nodes_gone, nodeid))
  291. return 1;
  292. return 0;
  293. }
  294. static void clear_memb_list(struct list_head *head)
  295. {
  296. struct dlm_member *memb;
  297. while (!list_empty(head)) {
  298. memb = list_entry(head->next, struct dlm_member, list);
  299. list_del(&memb->list);
  300. kfree(memb);
  301. }
  302. }
  303. void dlm_clear_members(struct dlm_ls *ls)
  304. {
  305. clear_memb_list(&ls->ls_nodes);
  306. ls->ls_num_nodes = 0;
  307. }
  308. void dlm_clear_members_gone(struct dlm_ls *ls)
  309. {
  310. clear_memb_list(&ls->ls_nodes_gone);
  311. }
  312. static void make_member_array(struct dlm_ls *ls)
  313. {
  314. struct dlm_member *memb;
  315. int i, w, x = 0, total = 0, all_zero = 0, *array;
  316. kfree(ls->ls_node_array);
  317. ls->ls_node_array = NULL;
  318. list_for_each_entry(memb, &ls->ls_nodes, list) {
  319. if (memb->weight)
  320. total += memb->weight;
  321. }
  322. /* all nodes revert to weight of 1 if all have weight 0 */
  323. if (!total) {
  324. total = ls->ls_num_nodes;
  325. all_zero = 1;
  326. }
  327. ls->ls_total_weight = total;
  328. array = kmalloc(sizeof(int) * total, GFP_NOFS);
  329. if (!array)
  330. return;
  331. list_for_each_entry(memb, &ls->ls_nodes, list) {
  332. if (!all_zero && !memb->weight)
  333. continue;
  334. if (all_zero)
  335. w = 1;
  336. else
  337. w = memb->weight;
  338. DLM_ASSERT(x < total, printk("total %d x %d\n", total, x););
  339. for (i = 0; i < w; i++)
  340. array[x++] = memb->nodeid;
  341. }
  342. ls->ls_node_array = array;
  343. }
  344. /* send a status request to all members just to establish comms connections */
  345. static int ping_members(struct dlm_ls *ls)
  346. {
  347. struct dlm_member *memb;
  348. int error = 0;
  349. list_for_each_entry(memb, &ls->ls_nodes, list) {
  350. error = dlm_recovery_stopped(ls);
  351. if (error)
  352. break;
  353. error = dlm_rcom_status(ls, memb->nodeid, 0);
  354. if (error)
  355. break;
  356. }
  357. if (error)
  358. log_rinfo(ls, "ping_members aborted %d last nodeid %d",
  359. error, ls->ls_recover_nodeid);
  360. return error;
  361. }
  362. static void dlm_lsop_recover_prep(struct dlm_ls *ls)
  363. {
  364. if (!ls->ls_ops || !ls->ls_ops->recover_prep)
  365. return;
  366. ls->ls_ops->recover_prep(ls->ls_ops_arg);
  367. }
  368. static void dlm_lsop_recover_slot(struct dlm_ls *ls, struct dlm_member *memb)
  369. {
  370. struct dlm_slot slot;
  371. uint32_t seq;
  372. int error;
  373. if (!ls->ls_ops || !ls->ls_ops->recover_slot)
  374. return;
  375. /* if there is no comms connection with this node
  376. or the present comms connection is newer
  377. than the one when this member was added, then
  378. we consider the node to have failed (versus
  379. being removed due to dlm_release_lockspace) */
  380. error = dlm_comm_seq(memb->nodeid, &seq);
  381. if (!error && seq == memb->comm_seq)
  382. return;
  383. slot.nodeid = memb->nodeid;
  384. slot.slot = memb->slot;
  385. ls->ls_ops->recover_slot(ls->ls_ops_arg, &slot);
  386. }
  387. void dlm_lsop_recover_done(struct dlm_ls *ls)
  388. {
  389. struct dlm_member *memb;
  390. struct dlm_slot *slots;
  391. int i, num;
  392. if (!ls->ls_ops || !ls->ls_ops->recover_done)
  393. return;
  394. num = ls->ls_num_nodes;
  395. slots = kzalloc(num * sizeof(struct dlm_slot), GFP_KERNEL);
  396. if (!slots)
  397. return;
  398. i = 0;
  399. list_for_each_entry(memb, &ls->ls_nodes, list) {
  400. if (i == num) {
  401. log_error(ls, "dlm_lsop_recover_done bad num %d", num);
  402. goto out;
  403. }
  404. slots[i].nodeid = memb->nodeid;
  405. slots[i].slot = memb->slot;
  406. i++;
  407. }
  408. ls->ls_ops->recover_done(ls->ls_ops_arg, slots, num,
  409. ls->ls_slot, ls->ls_generation);
  410. out:
  411. kfree(slots);
  412. }
  413. static struct dlm_config_node *find_config_node(struct dlm_recover *rv,
  414. int nodeid)
  415. {
  416. int i;
  417. for (i = 0; i < rv->nodes_count; i++) {
  418. if (rv->nodes[i].nodeid == nodeid)
  419. return &rv->nodes[i];
  420. }
  421. return NULL;
  422. }
  423. int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
  424. {
  425. struct dlm_member *memb, *safe;
  426. struct dlm_config_node *node;
  427. int i, error, neg = 0, low = -1;
  428. /* previously removed members that we've not finished removing need to
  429. count as a negative change so the "neg" recovery steps will happen */
  430. list_for_each_entry(memb, &ls->ls_nodes_gone, list) {
  431. log_rinfo(ls, "prev removed member %d", memb->nodeid);
  432. neg++;
  433. }
  434. /* move departed members from ls_nodes to ls_nodes_gone */
  435. list_for_each_entry_safe(memb, safe, &ls->ls_nodes, list) {
  436. node = find_config_node(rv, memb->nodeid);
  437. if (node && !node->new)
  438. continue;
  439. if (!node) {
  440. log_rinfo(ls, "remove member %d", memb->nodeid);
  441. } else {
  442. /* removed and re-added */
  443. log_rinfo(ls, "remove member %d comm_seq %u %u",
  444. memb->nodeid, memb->comm_seq, node->comm_seq);
  445. }
  446. neg++;
  447. list_move(&memb->list, &ls->ls_nodes_gone);
  448. ls->ls_num_nodes--;
  449. dlm_lsop_recover_slot(ls, memb);
  450. }
  451. /* add new members to ls_nodes */
  452. for (i = 0; i < rv->nodes_count; i++) {
  453. node = &rv->nodes[i];
  454. if (dlm_is_member(ls, node->nodeid))
  455. continue;
  456. dlm_add_member(ls, node);
  457. log_rinfo(ls, "add member %d", node->nodeid);
  458. }
  459. list_for_each_entry(memb, &ls->ls_nodes, list) {
  460. if (low == -1 || memb->nodeid < low)
  461. low = memb->nodeid;
  462. }
  463. ls->ls_low_nodeid = low;
  464. make_member_array(ls);
  465. *neg_out = neg;
  466. error = ping_members(ls);
  467. if (!error || error == -EPROTO) {
  468. /* new_lockspace() may be waiting to know if the config
  469. is good or bad */
  470. ls->ls_members_result = error;
  471. complete(&ls->ls_members_done);
  472. }
  473. log_rinfo(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
  474. return error;
  475. }
  476. /* Userspace guarantees that dlm_ls_stop() has completed on all nodes before
  477. dlm_ls_start() is called on any of them to start the new recovery. */
  478. int dlm_ls_stop(struct dlm_ls *ls)
  479. {
  480. int new;
  481. /*
  482. * Prevent dlm_recv from being in the middle of something when we do
  483. * the stop. This includes ensuring dlm_recv isn't processing a
  484. * recovery message (rcom), while dlm_recoverd is aborting and
  485. * resetting things from an in-progress recovery. i.e. we want
  486. * dlm_recoverd to abort its recovery without worrying about dlm_recv
  487. * processing an rcom at the same time. Stopping dlm_recv also makes
  488. * it easy for dlm_receive_message() to check locking stopped and add a
  489. * message to the requestqueue without races.
  490. */
  491. down_write(&ls->ls_recv_active);
  492. /*
  493. * Abort any recovery that's in progress (see RECOVER_STOP,
  494. * dlm_recovery_stopped()) and tell any other threads running in the
  495. * dlm to quit any processing (see RUNNING, dlm_locking_stopped()).
  496. */
  497. spin_lock(&ls->ls_recover_lock);
  498. set_bit(LSFL_RECOVER_STOP, &ls->ls_flags);
  499. new = test_and_clear_bit(LSFL_RUNNING, &ls->ls_flags);
  500. ls->ls_recover_seq++;
  501. spin_unlock(&ls->ls_recover_lock);
  502. /*
  503. * Let dlm_recv run again, now any normal messages will be saved on the
  504. * requestqueue for later.
  505. */
  506. up_write(&ls->ls_recv_active);
  507. /*
  508. * This in_recovery lock does two things:
  509. * 1) Keeps this function from returning until all threads are out
  510. * of locking routines and locking is truly stopped.
  511. * 2) Keeps any new requests from being processed until it's unlocked
  512. * when recovery is complete.
  513. */
  514. if (new) {
  515. set_bit(LSFL_RECOVER_DOWN, &ls->ls_flags);
  516. wake_up_process(ls->ls_recoverd_task);
  517. wait_event(ls->ls_recover_lock_wait,
  518. test_bit(LSFL_RECOVER_LOCK, &ls->ls_flags));
  519. }
  520. /*
  521. * The recoverd suspend/resume makes sure that dlm_recoverd (if
  522. * running) has noticed RECOVER_STOP above and quit processing the
  523. * previous recovery.
  524. */
  525. dlm_recoverd_suspend(ls);
  526. spin_lock(&ls->ls_recover_lock);
  527. kfree(ls->ls_slots);
  528. ls->ls_slots = NULL;
  529. ls->ls_num_slots = 0;
  530. ls->ls_slots_size = 0;
  531. ls->ls_recover_status = 0;
  532. spin_unlock(&ls->ls_recover_lock);
  533. dlm_recoverd_resume(ls);
  534. if (!ls->ls_recover_begin)
  535. ls->ls_recover_begin = jiffies;
  536. dlm_lsop_recover_prep(ls);
  537. return 0;
  538. }
  539. int dlm_ls_start(struct dlm_ls *ls)
  540. {
  541. struct dlm_recover *rv = NULL, *rv_old;
  542. struct dlm_config_node *nodes;
  543. int error, count;
  544. rv = kzalloc(sizeof(struct dlm_recover), GFP_NOFS);
  545. if (!rv)
  546. return -ENOMEM;
  547. error = dlm_config_nodes(ls->ls_name, &nodes, &count);
  548. if (error < 0)
  549. goto fail;
  550. spin_lock(&ls->ls_recover_lock);
  551. /* the lockspace needs to be stopped before it can be started */
  552. if (!dlm_locking_stopped(ls)) {
  553. spin_unlock(&ls->ls_recover_lock);
  554. log_error(ls, "start ignored: lockspace running");
  555. error = -EINVAL;
  556. goto fail;
  557. }
  558. rv->nodes = nodes;
  559. rv->nodes_count = count;
  560. rv->seq = ++ls->ls_recover_seq;
  561. rv_old = ls->ls_recover_args;
  562. ls->ls_recover_args = rv;
  563. spin_unlock(&ls->ls_recover_lock);
  564. if (rv_old) {
  565. log_error(ls, "unused recovery %llx %d",
  566. (unsigned long long)rv_old->seq, rv_old->nodes_count);
  567. kfree(rv_old->nodes);
  568. kfree(rv_old);
  569. }
  570. set_bit(LSFL_RECOVER_WORK, &ls->ls_flags);
  571. wake_up_process(ls->ls_recoverd_task);
  572. return 0;
  573. fail:
  574. kfree(rv);
  575. kfree(nodes);
  576. return error;
  577. }