@@ -251,10 +251,10 @@ int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp)
251
251
if (refcount_read (& net -> count ) == 0 )
252
252
return NETNSA_NSID_NOT_ASSIGNED ;
253
253
254
- spin_lock (& net -> nsid_lock );
254
+ spin_lock_bh (& net -> nsid_lock );
255
255
id = __peernet2id (net , peer );
256
256
if (id >= 0 ) {
257
- spin_unlock (& net -> nsid_lock );
257
+ spin_unlock_bh (& net -> nsid_lock );
258
258
return id ;
259
259
}
260
260
@@ -264,12 +264,12 @@ int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp)
264
264
* just been idr_remove()'d from there in cleanup_net().
265
265
*/
266
266
if (!maybe_get_net (peer )) {
267
- spin_unlock (& net -> nsid_lock );
267
+ spin_unlock_bh (& net -> nsid_lock );
268
268
return NETNSA_NSID_NOT_ASSIGNED ;
269
269
}
270
270
271
271
id = alloc_netid (net , peer , -1 );
272
- spin_unlock (& net -> nsid_lock );
272
+ spin_unlock_bh (& net -> nsid_lock );
273
273
274
274
put_net (peer );
275
275
if (id < 0 )
@@ -534,20 +534,20 @@ static void unhash_nsid(struct net *net, struct net *last)
534
534
for_each_net (tmp ) {
535
535
int id ;
536
536
537
- spin_lock (& tmp -> nsid_lock );
537
+ spin_lock_bh (& tmp -> nsid_lock );
538
538
id = __peernet2id (tmp , net );
539
539
if (id >= 0 )
540
540
idr_remove (& tmp -> netns_ids , id );
541
- spin_unlock (& tmp -> nsid_lock );
541
+ spin_unlock_bh (& tmp -> nsid_lock );
542
542
if (id >= 0 )
543
543
rtnl_net_notifyid (tmp , RTM_DELNSID , id , 0 , NULL ,
544
544
GFP_KERNEL );
545
545
if (tmp == last )
546
546
break ;
547
547
}
548
- spin_lock (& net -> nsid_lock );
548
+ spin_lock_bh (& net -> nsid_lock );
549
549
idr_destroy (& net -> netns_ids );
550
- spin_unlock (& net -> nsid_lock );
550
+ spin_unlock_bh (& net -> nsid_lock );
551
551
}
552
552
553
553
static LLIST_HEAD (cleanup_list );
@@ -760,9 +760,9 @@ static int rtnl_net_newid(struct sk_buff *skb, struct nlmsghdr *nlh,
760
760
return PTR_ERR (peer );
761
761
}
762
762
763
- spin_lock (& net -> nsid_lock );
763
+ spin_lock_bh (& net -> nsid_lock );
764
764
if (__peernet2id (net , peer ) >= 0 ) {
765
- spin_unlock (& net -> nsid_lock );
765
+ spin_unlock_bh (& net -> nsid_lock );
766
766
err = - EEXIST ;
767
767
NL_SET_BAD_ATTR (extack , nla );
768
768
NL_SET_ERR_MSG (extack ,
@@ -771,7 +771,7 @@ static int rtnl_net_newid(struct sk_buff *skb, struct nlmsghdr *nlh,
771
771
}
772
772
773
773
err = alloc_netid (net , peer , nsid );
774
- spin_unlock (& net -> nsid_lock );
774
+ spin_unlock_bh (& net -> nsid_lock );
775
775
if (err >= 0 ) {
776
776
rtnl_net_notifyid (net , RTM_NEWNSID , err , NETLINK_CB (skb ).portid ,
777
777
nlh , GFP_KERNEL );
0 commit comments