diff options
author | Daisuke Ogino <ogino.daisuke@jp.fujitsu.com> | 2011-07-26 19:08:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:43 -0400 |
commit | d2857e79a2ba7c155eaa1a7d3581c8d26b31e54e (patch) | |
tree | 6e008e65884e991c8696de2862166b7a0d603e06 /fs/proc | |
parent | 5296f6d315bdd8f1dc97348b788638327a6ab192 (diff) |
procfs: return ENOENT on opening a being-removed proc entry
Change the return value to ENOENT. This return value is then returned
when opening the proc entry that have been removed. For example,
open("/proc/bus/pci/XX/YY") when the corresponding device is being
hot-removed.
Signed-off-by: Daisuke Ogino <ogino.daisuke@jp.fujitsu.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 74b48cfa1bb2..7ed72d6c1c6f 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -319,7 +319,7 @@ static int proc_reg_open(struct inode *inode, struct file *file) | |||
319 | if (!pde->proc_fops) { | 319 | if (!pde->proc_fops) { |
320 | spin_unlock(&pde->pde_unload_lock); | 320 | spin_unlock(&pde->pde_unload_lock); |
321 | kfree(pdeo); | 321 | kfree(pdeo); |
322 | return -EINVAL; | 322 | return -ENOENT; |
323 | } | 323 | } |
324 | pde->pde_users++; | 324 | pde->pde_users++; |
325 | open = pde->proc_fops->open; | 325 | open = pde->proc_fops->open; |