diff options
| -rw-r--r-- | fs/proc/generic.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index e064f562b1f7..76ddae83daa5 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
| @@ -352,18 +352,18 @@ retry: | |||
| 352 | if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) | 352 | if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) |
| 353 | return -ENOMEM; | 353 | return -ENOMEM; |
| 354 | 354 | ||
| 355 | spin_lock_bh(&proc_inum_lock); | 355 | spin_lock_irq(&proc_inum_lock); |
| 356 | error = ida_get_new(&proc_inum_ida, &i); | 356 | error = ida_get_new(&proc_inum_ida, &i); |
| 357 | spin_unlock_bh(&proc_inum_lock); | 357 | spin_unlock_irq(&proc_inum_lock); |
| 358 | if (error == -EAGAIN) | 358 | if (error == -EAGAIN) |
| 359 | goto retry; | 359 | goto retry; |
| 360 | else if (error) | 360 | else if (error) |
| 361 | return error; | 361 | return error; |
| 362 | 362 | ||
| 363 | if (i > UINT_MAX - PROC_DYNAMIC_FIRST) { | 363 | if (i > UINT_MAX - PROC_DYNAMIC_FIRST) { |
| 364 | spin_lock_bh(&proc_inum_lock); | 364 | spin_lock_irq(&proc_inum_lock); |
| 365 | ida_remove(&proc_inum_ida, i); | 365 | ida_remove(&proc_inum_ida, i); |
| 366 | spin_unlock_bh(&proc_inum_lock); | 366 | spin_unlock_irq(&proc_inum_lock); |
| 367 | return -ENOSPC; | 367 | return -ENOSPC; |
| 368 | } | 368 | } |
| 369 | *inum = PROC_DYNAMIC_FIRST + i; | 369 | *inum = PROC_DYNAMIC_FIRST + i; |
| @@ -372,9 +372,10 @@ retry: | |||
| 372 | 372 | ||
| 373 | void proc_free_inum(unsigned int inum) | 373 | void proc_free_inum(unsigned int inum) |
| 374 | { | 374 | { |
| 375 | spin_lock_bh(&proc_inum_lock); | 375 | unsigned long flags; |
| 376 | spin_lock_irqsave(&proc_inum_lock, flags); | ||
| 376 | ida_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); | 377 | ida_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); |
| 377 | spin_unlock_bh(&proc_inum_lock); | 378 | spin_unlock_irqrestore(&proc_inum_lock, flags); |
| 378 | } | 379 | } |
| 379 | 380 | ||
| 380 | static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) | 381 | static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) |
