diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/inode.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 38f5c119b806..98a7d2870bef 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -486,6 +486,8 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) | |||
486 | 486 | ||
487 | int proc_fill_super(struct super_block *s) | 487 | int proc_fill_super(struct super_block *s) |
488 | { | 488 | { |
489 | struct inode *root_inode; | ||
490 | |||
489 | s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC; | 491 | s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC; |
490 | s->s_blocksize = 1024; | 492 | s->s_blocksize = 1024; |
491 | s->s_blocksize_bits = 10; | 493 | s->s_blocksize_bits = 10; |
@@ -494,11 +496,18 @@ int proc_fill_super(struct super_block *s) | |||
494 | s->s_time_gran = 1; | 496 | s->s_time_gran = 1; |
495 | 497 | ||
496 | pde_get(&proc_root); | 498 | pde_get(&proc_root); |
497 | s->s_root = d_make_root(proc_get_inode(s, &proc_root)); | 499 | root_inode = proc_get_inode(s, &proc_root); |
498 | if (s->s_root) | 500 | if (!root_inode) { |
499 | return 0; | 501 | printk(KERN_ERR "proc_fill_super: get root inode failed\n"); |
502 | pde_put(&proc_root); | ||
503 | return -ENOMEM; | ||
504 | } | ||
500 | 505 | ||
501 | printk("proc_read_super: get root inode failed\n"); | 506 | s->s_root = d_make_root(root_inode); |
502 | pde_put(&proc_root); | 507 | if (!s->s_root) { |
503 | return -ENOMEM; | 508 | printk(KERN_ERR "proc_fill_super: allocate dentry failed\n"); |
509 | return -ENOMEM; | ||
510 | } | ||
511 | |||
512 | return 0; | ||
504 | } | 513 | } |