batman-adv: Correct rcu refcounting for neigh_node
[firefly-linux-kernel-4.4.55.git] / net / batman-adv / originator.c
1 /*
2  * Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
3  *
4  * Marek Lindner, Simon Wunderlich
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2 of the GNU General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA
19  *
20  */
21
22 /* increase the reference counter for this originator */
23
24 #include "main.h"
25 #include "originator.h"
26 #include "hash.h"
27 #include "translation-table.h"
28 #include "routing.h"
29 #include "gateway_client.h"
30 #include "hard-interface.h"
31 #include "unicast.h"
32 #include "soft-interface.h"
33
34 static void purge_orig(struct work_struct *work);
35
36 static void start_purge_timer(struct bat_priv *bat_priv)
37 {
38         INIT_DELAYED_WORK(&bat_priv->orig_work, purge_orig);
39         queue_delayed_work(bat_event_workqueue, &bat_priv->orig_work, 1 * HZ);
40 }
41
42 int originator_init(struct bat_priv *bat_priv)
43 {
44         if (bat_priv->orig_hash)
45                 return 1;
46
47         spin_lock_bh(&bat_priv->orig_hash_lock);
48         bat_priv->orig_hash = hash_new(1024);
49
50         if (!bat_priv->orig_hash)
51                 goto err;
52
53         spin_unlock_bh(&bat_priv->orig_hash_lock);
54         start_purge_timer(bat_priv);
55         return 1;
56
57 err:
58         spin_unlock_bh(&bat_priv->orig_hash_lock);
59         return 0;
60 }
61
62 static void neigh_node_free_rcu(struct rcu_head *rcu)
63 {
64         struct neigh_node *neigh_node;
65
66         neigh_node = container_of(rcu, struct neigh_node, rcu);
67         kfree(neigh_node);
68 }
69
70 void neigh_node_free_ref(struct neigh_node *neigh_node)
71 {
72         if (atomic_dec_and_test(&neigh_node->refcount))
73                 call_rcu(&neigh_node->rcu, neigh_node_free_rcu);
74 }
75
76 struct neigh_node *create_neighbor(struct orig_node *orig_node,
77                                    struct orig_node *orig_neigh_node,
78                                    uint8_t *neigh,
79                                    struct batman_if *if_incoming)
80 {
81         struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
82         struct neigh_node *neigh_node;
83
84         bat_dbg(DBG_BATMAN, bat_priv,
85                 "Creating new last-hop neighbor of originator\n");
86
87         neigh_node = kzalloc(sizeof(struct neigh_node), GFP_ATOMIC);
88         if (!neigh_node)
89                 return NULL;
90
91         INIT_HLIST_NODE(&neigh_node->list);
92         INIT_LIST_HEAD(&neigh_node->bonding_list);
93
94         memcpy(neigh_node->addr, neigh, ETH_ALEN);
95         neigh_node->orig_node = orig_neigh_node;
96         neigh_node->if_incoming = if_incoming;
97         atomic_set(&neigh_node->refcount, 1);
98
99         spin_lock_bh(&orig_node->neigh_list_lock);
100         hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list);
101         spin_unlock_bh(&orig_node->neigh_list_lock);
102         return neigh_node;
103 }
104
105 void orig_node_free_ref(struct kref *refcount)
106 {
107         struct hlist_node *node, *node_tmp;
108         struct neigh_node *neigh_node, *tmp_neigh_node;
109         struct orig_node *orig_node;
110
111         orig_node = container_of(refcount, struct orig_node, refcount);
112
113         spin_lock_bh(&orig_node->neigh_list_lock);
114
115         /* for all bonding members ... */
116         list_for_each_entry_safe(neigh_node, tmp_neigh_node,
117                                  &orig_node->bond_list, bonding_list) {
118                 list_del_rcu(&neigh_node->bonding_list);
119                 neigh_node_free_ref(neigh_node);
120         }
121
122         /* for all neighbors towards this originator ... */
123         hlist_for_each_entry_safe(neigh_node, node, node_tmp,
124                                   &orig_node->neigh_list, list) {
125                 hlist_del_rcu(&neigh_node->list);
126                 neigh_node_free_ref(neigh_node);
127         }
128
129         spin_unlock_bh(&orig_node->neigh_list_lock);
130
131         frag_list_free(&orig_node->frag_list);
132         hna_global_del_orig(orig_node->bat_priv, orig_node,
133                             "originator timed out");
134
135         kfree(orig_node->bcast_own);
136         kfree(orig_node->bcast_own_sum);
137         kfree(orig_node);
138 }
139
140 void originator_free(struct bat_priv *bat_priv)
141 {
142         struct hashtable_t *hash = bat_priv->orig_hash;
143         struct hlist_node *walk, *safe;
144         struct hlist_head *head;
145         struct element_t *bucket;
146         spinlock_t *list_lock; /* spinlock to protect write access */
147         struct orig_node *orig_node;
148         int i;
149
150         if (!hash)
151                 return;
152
153         cancel_delayed_work_sync(&bat_priv->orig_work);
154
155         spin_lock_bh(&bat_priv->orig_hash_lock);
156         bat_priv->orig_hash = NULL;
157
158         for (i = 0; i < hash->size; i++) {
159                 head = &hash->table[i];
160                 list_lock = &hash->list_locks[i];
161
162                 spin_lock_bh(list_lock);
163                 hlist_for_each_entry_safe(bucket, walk, safe, head, hlist) {
164                         orig_node = bucket->data;
165
166                         hlist_del_rcu(walk);
167                         call_rcu(&bucket->rcu, bucket_free_rcu);
168                         kref_put(&orig_node->refcount, orig_node_free_ref);
169                 }
170                 spin_unlock_bh(list_lock);
171         }
172
173         hash_destroy(hash);
174         spin_unlock_bh(&bat_priv->orig_hash_lock);
175 }
176
177 static void bucket_free_orig_rcu(struct rcu_head *rcu)
178 {
179         struct element_t *bucket;
180         struct orig_node *orig_node;
181
182         bucket = container_of(rcu, struct element_t, rcu);
183         orig_node = bucket->data;
184
185         kref_put(&orig_node->refcount, orig_node_free_ref);
186         kfree(bucket);
187 }
188
189 /* this function finds or creates an originator entry for the given
190  * address if it does not exits */
191 struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr)
192 {
193         struct orig_node *orig_node;
194         int size;
195         int hash_added;
196
197         rcu_read_lock();
198         orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash,
199                                                    compare_orig, choose_orig,
200                                                    addr));
201         rcu_read_unlock();
202
203         if (orig_node) {
204                 kref_get(&orig_node->refcount);
205                 return orig_node;
206         }
207
208         bat_dbg(DBG_BATMAN, bat_priv,
209                 "Creating new originator: %pM\n", addr);
210
211         orig_node = kzalloc(sizeof(struct orig_node), GFP_ATOMIC);
212         if (!orig_node)
213                 return NULL;
214
215         INIT_HLIST_HEAD(&orig_node->neigh_list);
216         INIT_LIST_HEAD(&orig_node->bond_list);
217         spin_lock_init(&orig_node->ogm_cnt_lock);
218         spin_lock_init(&orig_node->neigh_list_lock);
219         kref_init(&orig_node->refcount);
220
221         orig_node->bat_priv = bat_priv;
222         memcpy(orig_node->orig, addr, ETH_ALEN);
223         orig_node->router = NULL;
224         orig_node->hna_buff = NULL;
225         orig_node->bcast_seqno_reset = jiffies - 1
226                                         - msecs_to_jiffies(RESET_PROTECTION_MS);
227         orig_node->batman_seqno_reset = jiffies - 1
228                                         - msecs_to_jiffies(RESET_PROTECTION_MS);
229
230         atomic_set(&orig_node->bond_candidates, 0);
231
232         size = bat_priv->num_ifaces * sizeof(unsigned long) * NUM_WORDS;
233
234         orig_node->bcast_own = kzalloc(size, GFP_ATOMIC);
235         if (!orig_node->bcast_own)
236                 goto free_orig_node;
237
238         size = bat_priv->num_ifaces * sizeof(uint8_t);
239         orig_node->bcast_own_sum = kzalloc(size, GFP_ATOMIC);
240
241         INIT_LIST_HEAD(&orig_node->frag_list);
242         orig_node->last_frag_packet = 0;
243
244         if (!orig_node->bcast_own_sum)
245                 goto free_bcast_own;
246
247         hash_added = hash_add(bat_priv->orig_hash, compare_orig, choose_orig,
248                               orig_node);
249         if (hash_added < 0)
250                 goto free_bcast_own_sum;
251
252         /* extra reference for return */
253         kref_get(&orig_node->refcount);
254         return orig_node;
255 free_bcast_own_sum:
256         kfree(orig_node->bcast_own_sum);
257 free_bcast_own:
258         kfree(orig_node->bcast_own);
259 free_orig_node:
260         kfree(orig_node);
261         return NULL;
262 }
263
264 static bool purge_orig_neighbors(struct bat_priv *bat_priv,
265                                  struct orig_node *orig_node,
266                                  struct neigh_node **best_neigh_node)
267 {
268         struct hlist_node *node, *node_tmp;
269         struct neigh_node *neigh_node;
270         bool neigh_purged = false;
271
272         *best_neigh_node = NULL;
273
274         spin_lock_bh(&orig_node->neigh_list_lock);
275
276         /* for all neighbors towards this originator ... */
277         hlist_for_each_entry_safe(neigh_node, node, node_tmp,
278                                   &orig_node->neigh_list, list) {
279
280                 if ((time_after(jiffies,
281                         neigh_node->last_valid + PURGE_TIMEOUT * HZ)) ||
282                     (neigh_node->if_incoming->if_status == IF_INACTIVE) ||
283                     (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) ||
284                     (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) {
285
286                         if ((neigh_node->if_incoming->if_status ==
287                                                                 IF_INACTIVE) ||
288                             (neigh_node->if_incoming->if_status ==
289                                                         IF_NOT_IN_USE) ||
290                             (neigh_node->if_incoming->if_status ==
291                                                         IF_TO_BE_REMOVED))
292                                 bat_dbg(DBG_BATMAN, bat_priv,
293                                         "neighbor purge: originator %pM, "
294                                         "neighbor: %pM, iface: %s\n",
295                                         orig_node->orig, neigh_node->addr,
296                                         neigh_node->if_incoming->net_dev->name);
297                         else
298                                 bat_dbg(DBG_BATMAN, bat_priv,
299                                         "neighbor timeout: originator %pM, "
300                                         "neighbor: %pM, last_valid: %lu\n",
301                                         orig_node->orig, neigh_node->addr,
302                                         (neigh_node->last_valid / HZ));
303
304                         neigh_purged = true;
305
306                         hlist_del_rcu(&neigh_node->list);
307                         bonding_candidate_del(orig_node, neigh_node);
308                         neigh_node_free_ref(neigh_node);
309                 } else {
310                         if ((!*best_neigh_node) ||
311                             (neigh_node->tq_avg > (*best_neigh_node)->tq_avg))
312                                 *best_neigh_node = neigh_node;
313                 }
314         }
315
316         spin_unlock_bh(&orig_node->neigh_list_lock);
317         return neigh_purged;
318 }
319
320 static bool purge_orig_node(struct bat_priv *bat_priv,
321                             struct orig_node *orig_node)
322 {
323         struct neigh_node *best_neigh_node;
324
325         if (time_after(jiffies,
326                 orig_node->last_valid + 2 * PURGE_TIMEOUT * HZ)) {
327
328                 bat_dbg(DBG_BATMAN, bat_priv,
329                         "Originator timeout: originator %pM, last_valid %lu\n",
330                         orig_node->orig, (orig_node->last_valid / HZ));
331                 return true;
332         } else {
333                 if (purge_orig_neighbors(bat_priv, orig_node,
334                                                         &best_neigh_node)) {
335                         update_routes(bat_priv, orig_node,
336                                       best_neigh_node,
337                                       orig_node->hna_buff,
338                                       orig_node->hna_buff_len);
339                 }
340         }
341
342         return false;
343 }
344
345 static void _purge_orig(struct bat_priv *bat_priv)
346 {
347         struct hashtable_t *hash = bat_priv->orig_hash;
348         struct hlist_node *walk, *safe;
349         struct hlist_head *head;
350         struct element_t *bucket;
351         spinlock_t *list_lock; /* spinlock to protect write access */
352         struct orig_node *orig_node;
353         int i;
354
355         if (!hash)
356                 return;
357
358         spin_lock_bh(&bat_priv->orig_hash_lock);
359
360         /* for all origins... */
361         for (i = 0; i < hash->size; i++) {
362                 head = &hash->table[i];
363                 list_lock = &hash->list_locks[i];
364
365                 spin_lock_bh(list_lock);
366                 hlist_for_each_entry_safe(bucket, walk, safe, head, hlist) {
367                         orig_node = bucket->data;
368
369                         if (purge_orig_node(bat_priv, orig_node)) {
370                                 if (orig_node->gw_flags)
371                                         gw_node_delete(bat_priv, orig_node);
372                                 hlist_del_rcu(walk);
373                                 call_rcu(&bucket->rcu, bucket_free_orig_rcu);
374                                 continue;
375                         }
376
377                         if (time_after(jiffies, orig_node->last_frag_packet +
378                                                 msecs_to_jiffies(FRAG_TIMEOUT)))
379                                 frag_list_free(&orig_node->frag_list);
380                 }
381                 spin_unlock_bh(list_lock);
382         }
383
384         spin_unlock_bh(&bat_priv->orig_hash_lock);
385
386         gw_node_purge(bat_priv);
387         gw_election(bat_priv);
388
389         softif_neigh_purge(bat_priv);
390 }
391
392 static void purge_orig(struct work_struct *work)
393 {
394         struct delayed_work *delayed_work =
395                 container_of(work, struct delayed_work, work);
396         struct bat_priv *bat_priv =
397                 container_of(delayed_work, struct bat_priv, orig_work);
398
399         _purge_orig(bat_priv);
400         start_purge_timer(bat_priv);
401 }
402
403 void purge_orig_ref(struct bat_priv *bat_priv)
404 {
405         _purge_orig(bat_priv);
406 }
407
408 int orig_seq_print_text(struct seq_file *seq, void *offset)
409 {
410         struct net_device *net_dev = (struct net_device *)seq->private;
411         struct bat_priv *bat_priv = netdev_priv(net_dev);
412         struct hashtable_t *hash = bat_priv->orig_hash;
413         struct hlist_node *walk, *node;
414         struct hlist_head *head;
415         struct element_t *bucket;
416         struct orig_node *orig_node;
417         struct neigh_node *neigh_node;
418         int batman_count = 0;
419         int last_seen_secs;
420         int last_seen_msecs;
421         int i;
422
423         if ((!bat_priv->primary_if) ||
424             (bat_priv->primary_if->if_status != IF_ACTIVE)) {
425                 if (!bat_priv->primary_if)
426                         return seq_printf(seq, "BATMAN mesh %s disabled - "
427                                      "please specify interfaces to enable it\n",
428                                      net_dev->name);
429
430                 return seq_printf(seq, "BATMAN mesh %s "
431                                   "disabled - primary interface not active\n",
432                                   net_dev->name);
433         }
434
435         seq_printf(seq, "[B.A.T.M.A.N. adv %s%s, MainIF/MAC: %s/%pM (%s)]\n",
436                    SOURCE_VERSION, REVISION_VERSION_STR,
437                    bat_priv->primary_if->net_dev->name,
438                    bat_priv->primary_if->net_dev->dev_addr, net_dev->name);
439         seq_printf(seq, "  %-15s %s (%s/%i) %17s [%10s]: %20s ...\n",
440                    "Originator", "last-seen", "#", TQ_MAX_VALUE, "Nexthop",
441                    "outgoingIF", "Potential nexthops");
442
443         spin_lock_bh(&bat_priv->orig_hash_lock);
444
445         for (i = 0; i < hash->size; i++) {
446                 head = &hash->table[i];
447
448                 rcu_read_lock();
449                 hlist_for_each_entry_rcu(bucket, walk, head, hlist) {
450                         orig_node = bucket->data;
451
452                         if (!orig_node->router)
453                                 continue;
454
455                         if (orig_node->router->tq_avg == 0)
456                                 continue;
457
458                         last_seen_secs = jiffies_to_msecs(jiffies -
459                                                 orig_node->last_valid) / 1000;
460                         last_seen_msecs = jiffies_to_msecs(jiffies -
461                                                 orig_node->last_valid) % 1000;
462
463                         neigh_node = orig_node->router;
464                         seq_printf(seq, "%pM %4i.%03is   (%3i) %pM [%10s]:",
465                                    orig_node->orig, last_seen_secs,
466                                    last_seen_msecs, neigh_node->tq_avg,
467                                    neigh_node->addr,
468                                    neigh_node->if_incoming->net_dev->name);
469
470                         hlist_for_each_entry_rcu(neigh_node, node,
471                                                  &orig_node->neigh_list, list) {
472                                 seq_printf(seq, " %pM (%3i)", neigh_node->addr,
473                                                 neigh_node->tq_avg);
474                         }
475
476                         seq_printf(seq, "\n");
477                         batman_count++;
478                 }
479                 rcu_read_unlock();
480         }
481
482         spin_unlock_bh(&bat_priv->orig_hash_lock);
483
484         if ((batman_count == 0))
485                 seq_printf(seq, "No batman nodes in range ...\n");
486
487         return 0;
488 }
489
490 static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
491 {
492         void *data_ptr;
493
494         data_ptr = kmalloc(max_if_num * sizeof(unsigned long) * NUM_WORDS,
495                            GFP_ATOMIC);
496         if (!data_ptr) {
497                 pr_err("Can't resize orig: out of memory\n");
498                 return -1;
499         }
500
501         memcpy(data_ptr, orig_node->bcast_own,
502                (max_if_num - 1) * sizeof(unsigned long) * NUM_WORDS);
503         kfree(orig_node->bcast_own);
504         orig_node->bcast_own = data_ptr;
505
506         data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
507         if (!data_ptr) {
508                 pr_err("Can't resize orig: out of memory\n");
509                 return -1;
510         }
511
512         memcpy(data_ptr, orig_node->bcast_own_sum,
513                (max_if_num - 1) * sizeof(uint8_t));
514         kfree(orig_node->bcast_own_sum);
515         orig_node->bcast_own_sum = data_ptr;
516
517         return 0;
518 }
519
520 int orig_hash_add_if(struct batman_if *batman_if, int max_if_num)
521 {
522         struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
523         struct hashtable_t *hash = bat_priv->orig_hash;
524         struct hlist_node *walk;
525         struct hlist_head *head;
526         struct element_t *bucket;
527         struct orig_node *orig_node;
528         int i, ret;
529
530         /* resize all orig nodes because orig_node->bcast_own(_sum) depend on
531          * if_num */
532         spin_lock_bh(&bat_priv->orig_hash_lock);
533
534         for (i = 0; i < hash->size; i++) {
535                 head = &hash->table[i];
536
537                 rcu_read_lock();
538                 hlist_for_each_entry_rcu(bucket, walk, head, hlist) {
539                         orig_node = bucket->data;
540
541                         spin_lock_bh(&orig_node->ogm_cnt_lock);
542                         ret = orig_node_add_if(orig_node, max_if_num);
543                         spin_unlock_bh(&orig_node->ogm_cnt_lock);
544
545                         if (ret == -1)
546                                 goto err;
547                 }
548                 rcu_read_unlock();
549         }
550
551         spin_unlock_bh(&bat_priv->orig_hash_lock);
552         return 0;
553
554 err:
555         rcu_read_unlock();
556         spin_unlock_bh(&bat_priv->orig_hash_lock);
557         return -ENOMEM;
558 }
559
560 static int orig_node_del_if(struct orig_node *orig_node,
561                      int max_if_num, int del_if_num)
562 {
563         void *data_ptr = NULL;
564         int chunk_size;
565
566         /* last interface was removed */
567         if (max_if_num == 0)
568                 goto free_bcast_own;
569
570         chunk_size = sizeof(unsigned long) * NUM_WORDS;
571         data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
572         if (!data_ptr) {
573                 pr_err("Can't resize orig: out of memory\n");
574                 return -1;
575         }
576
577         /* copy first part */
578         memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
579
580         /* copy second part */
581         memcpy(data_ptr + del_if_num * chunk_size,
582                orig_node->bcast_own + ((del_if_num + 1) * chunk_size),
583                (max_if_num - del_if_num) * chunk_size);
584
585 free_bcast_own:
586         kfree(orig_node->bcast_own);
587         orig_node->bcast_own = data_ptr;
588
589         if (max_if_num == 0)
590                 goto free_own_sum;
591
592         data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
593         if (!data_ptr) {
594                 pr_err("Can't resize orig: out of memory\n");
595                 return -1;
596         }
597
598         memcpy(data_ptr, orig_node->bcast_own_sum,
599                del_if_num * sizeof(uint8_t));
600
601         memcpy(data_ptr + del_if_num * sizeof(uint8_t),
602                orig_node->bcast_own_sum + ((del_if_num + 1) * sizeof(uint8_t)),
603                (max_if_num - del_if_num) * sizeof(uint8_t));
604
605 free_own_sum:
606         kfree(orig_node->bcast_own_sum);
607         orig_node->bcast_own_sum = data_ptr;
608
609         return 0;
610 }
611
612 int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
613 {
614         struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
615         struct hashtable_t *hash = bat_priv->orig_hash;
616         struct hlist_node *walk;
617         struct hlist_head *head;
618         struct element_t *bucket;
619         struct batman_if *batman_if_tmp;
620         struct orig_node *orig_node;
621         int i, ret;
622
623         /* resize all orig nodes because orig_node->bcast_own(_sum) depend on
624          * if_num */
625         spin_lock_bh(&bat_priv->orig_hash_lock);
626
627         for (i = 0; i < hash->size; i++) {
628                 head = &hash->table[i];
629
630                 rcu_read_lock();
631                 hlist_for_each_entry_rcu(bucket, walk, head, hlist) {
632                         orig_node = bucket->data;
633
634                         spin_lock_bh(&orig_node->ogm_cnt_lock);
635                         ret = orig_node_del_if(orig_node, max_if_num,
636                                         batman_if->if_num);
637                         spin_unlock_bh(&orig_node->ogm_cnt_lock);
638
639                         if (ret == -1)
640                                 goto err;
641                 }
642                 rcu_read_unlock();
643         }
644
645         /* renumber remaining batman interfaces _inside_ of orig_hash_lock */
646         rcu_read_lock();
647         list_for_each_entry_rcu(batman_if_tmp, &if_list, list) {
648                 if (batman_if_tmp->if_status == IF_NOT_IN_USE)
649                         continue;
650
651                 if (batman_if == batman_if_tmp)
652                         continue;
653
654                 if (batman_if->soft_iface != batman_if_tmp->soft_iface)
655                         continue;
656
657                 if (batman_if_tmp->if_num > batman_if->if_num)
658                         batman_if_tmp->if_num--;
659         }
660         rcu_read_unlock();
661
662         batman_if->if_num = -1;
663         spin_unlock_bh(&bat_priv->orig_hash_lock);
664         return 0;
665
666 err:
667         rcu_read_unlock();
668         spin_unlock_bh(&bat_priv->orig_hash_lock);
669         return -ENOMEM;
670 }