Commit d2857e79 authored by Daisuke Ogino's avatar Daisuke Ogino Committed by Linus Torvalds

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: default avatarDaisuke Ogino <ogino.daisuke@jp.fujitsu.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5296f6d3
...@@ -319,7 +319,7 @@ static int proc_reg_open(struct inode *inode, struct file *file) ...@@ -319,7 +319,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
if (!pde->proc_fops) { if (!pde->proc_fops) {
spin_unlock(&pde->pde_unload_lock); spin_unlock(&pde->pde_unload_lock);
kfree(pdeo); kfree(pdeo);
return -EINVAL; return -ENOENT;
} }
pde->pde_users++; pde->pde_users++;
open = pde->proc_fops->open; open = pde->proc_fops->open;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment