--- linux-2.6.18-rc4-mm1/fs/reiserfs/super.c~reiserfs-fix-fill_super 2006-09-01 21:13:02.000000000 +0400 +++ linux-2.6.18-rc4-mm1/fs/reiserfs/super.c~reiserfs-fix-fill_super 2006-09-03 11:33:12.000000000 +0400 @@ -1384,7 +1384,7 @@ static __u32 find_hash_out(struct super_ do { // Some serious "goto"-hater was there ;) u32 teahash, r5hash, yurahash; - make_cpu_key(&key, inode, ~0, TYPE_DIRENTRY, 3); + make_cpu_key(&key, inode, LLONG_MAX, TYPE_DIRENTRY, 3); retval = search_by_entry_key(s, &key, &path, &de); if (retval == IO_ERROR) { pathrelse(&path); @@ -1549,7 +1549,7 @@ static int reiserfs_fill_super(struct su struct reiserfs_super_block *rs; char *jdev_name; struct reiserfs_sb_info *sbi; - int errval = -EINVAL; + int errval; sbi = kmalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL); if (!sbi) { @@ -1576,12 +1576,14 @@ static int reiserfs_fill_super(struct su if (reiserfs_parse_options (s, (char *)data, &(sbi->s_mount_opt), &blocks, &jdev_name, &commit_max_age) == 0) { + errval = -EINVAL; goto error; } if (blocks) { SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option " "for remount only"); + errval = -EINVAL; goto error; } @@ -1593,6 +1595,7 @@ static int reiserfs_fill_super(struct su SWARN(silent, s, "sh-2021: reiserfs_fill_super: can not find reiserfs on %s", reiserfs_bdevname(s)); + errval = -EINVAL; goto error; } @@ -1610,6 +1613,7 @@ static int reiserfs_fill_super(struct su "You may need to run fsck or increase size of your LVM partition"); SWARN(silent, s, "Or may be you forgot to reboot after fdisk when it told you to"); + errval = -EINVAL; goto error; } @@ -1649,6 +1653,7 @@ static int reiserfs_fill_super(struct su if (journal_init(s, jdev_name, old_format, commit_max_age)) { SWARN(silent, s, "sh-2022: reiserfs_fill_super: unable to initialize journal space"); + errval = -ENODEV; goto error; } else { jinit_done = 1; /* once this is set, journal_release must be called @@ -1658,11 +1663,14 @@ static int reiserfs_fill_super(struct su if (reread_meta_blocks(s)) { SWARN(silent, s, "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init"); + errval = -ENODEV; goto error; } - if (replay_only(s)) + if (replay_only(s)) { + errval = -EINVAL; goto error; + } if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) { SWARN(silent, s, @@ -1677,6 +1685,7 @@ static int reiserfs_fill_super(struct su if (!root_inode) { SWARN(silent, s, "jmacd-10: reiserfs_fill_super: get root inode failed"); + errval = -ENODEV; goto error; } @@ -1688,6 +1697,7 @@ static int reiserfs_fill_super(struct su s->s_root = d_alloc_root(root_inode); if (!s->s_root) { iput(root_inode); + errval = -ENOMEM; goto error; } // define and initialize hash function @@ -1695,6 +1705,7 @@ static int reiserfs_fill_super(struct su if (sbi->s_hash_function == NULL) { dput(s->s_root); s->s_root = NULL; + errval = -ENODEV; goto error; }