ARM: 6165/1: trap overflows on highmem pages from kmap_atomic when debugging
[safe/jmp/linux-2.6] / fs / freevxfs / vxfs_super.c
index 4f95572..1e8af93 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/buffer_head.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/stat.h>
 #include <linux/vfs.h>
 #include <linux/mount.h>
@@ -60,7 +61,6 @@ static int            vxfs_statfs(struct dentry *, struct kstatfs *);
 static int             vxfs_remount(struct super_block *, int *, char *);
 
 static const struct super_operations vxfs_super_ops = {
-       .read_inode =           vxfs_read_inode,
        .clear_inode =          vxfs_clear_inode,
        .put_super =            vxfs_put_super,
        .statfs =               vxfs_statfs,
@@ -81,12 +81,16 @@ vxfs_put_super(struct super_block *sbp)
 {
        struct vxfs_sb_info     *infp = VXFS_SBI(sbp);
 
+       lock_kernel();
+
        vxfs_put_fake_inode(infp->vsi_fship);
        vxfs_put_fake_inode(infp->vsi_ilist);
        vxfs_put_fake_inode(infp->vsi_stilist);
 
        brelse(infp->vsi_bp);
        kfree(infp);
+
+       unlock_kernel();
 }
 
 /**
@@ -153,6 +157,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
        struct buffer_head      *bp = NULL;
        u_long                  bsize;
        struct inode *root;
+       int ret = -EINVAL;
 
        sbp->s_flags |= MS_RDONLY;
 
@@ -219,7 +224,11 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
        }
 
        sbp->s_op = &vxfs_super_ops;
-       root = iget(sbp, VXFS_ROOT_INO);
+       root = vxfs_iget(sbp, VXFS_ROOT_INO);
+       if (IS_ERR(root)) {
+               ret = PTR_ERR(root);
+               goto out;
+       }
        sbp->s_root = d_alloc_root(root);
        if (!sbp->s_root) {
                iput(root);
@@ -236,7 +245,7 @@ out_free_ilist:
 out:
        brelse(bp);
        kfree(infp);
-       return -EINVAL;
+       return ret;
 }
 
 /*