]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix error code which fat_fill_super() returns (1/5)
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Sat, 12 Oct 2002 10:23:32 +0000 (03:23 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 12 Oct 2002 10:23:32 +0000 (03:23 -0700)
This fixes the error code which fat_fill_super() returns.

fs/fat/inode.c
fs/msdos/namei.c
fs/vfat/namei.c

index 89a3b19085de58a8e3ab1a667a2164bb77de88fe..7ea79492af611b092740858bdfeafd2e0149446d 100644 (file)
@@ -639,7 +639,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
        int logical_sector_size, fat_clusters, debug, cp, first;
        unsigned int total_sectors, rootdir_sectors;
        unsigned char media;
-       long error = -EIO;
+       long error;
        char buf[50];
        int i;
        char cvf_format[21];
@@ -662,6 +662,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
        sbi->dir_ops = fs_dir_inode_ops;
        sbi->cvf_format = &default_cvf;
 
+       error = -EINVAL;
        if (!parse_options((char *)data, &debug, &sbi->options,
                           cvf_format, cvf_options))
                goto out_fail;
@@ -670,6 +671,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
        /* set up enough so that it can read an inode */
        init_MUTEX(&sbi->fat_lock);
 
+       error = -EIO;
        sb_min_blocksize(sb, 512);
        bh = sb_bread(sb, 0);
        if (bh == NULL) {
@@ -848,13 +850,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
                goto out_invalid;
        }
 
+       error = -EINVAL;
        if (!strcmp(cvf_format, "none"))
                i = -1;
        else
                i = detect_cvf(sb, cvf_format);
        if (i >= 0) {
                if (cvf_formats[i]->mount_cvf(sb, cvf_options))
-                       goto out_invalid;
+                       goto out_fail;
        }
 
        cp = sbi->options.codepage ? sbi->options.codepage : 437;
@@ -912,6 +915,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 
 out_invalid:
        error = -EINVAL;
+       if (!silent)
+               printk(KERN_INFO "VFS: Can't find a valid FAT filesystem"
+                      " on dev %s.\n", sb->s_id);
 
 out_fail:
        if (root_inode)
index 22536013f55154f685290a5ec48ba4fde0575307..a35b048ea2c527a48870bb8593ffa3bd3a8705e2 100644 (file)
@@ -604,12 +604,8 @@ int msdos_fill_super(struct super_block *sb,void *data, int silent)
        int res;
 
        res = fat_fill_super(sb, data, silent, &msdos_dir_inode_operations, 0);
-       if (res) {
-               if (res == -EINVAL && !silent)
-                       printk(KERN_INFO "VFS: Can't find a valid"
-                              " MSDOS filesystem on dev %s.\n", sb->s_id);
+       if (res)
                return res;
-       }
 
        sb->s_root->d_op = &msdos_dentry_operations;
        return 0;
index 5dd82faa186d646bf2103cc3a11210680a9beb4b..830054606c9bfcdabf488f59adece9efb7c8be1b 100644 (file)
@@ -1284,12 +1284,8 @@ int vfat_fill_super(struct super_block *sb, void *data, int silent)
        struct msdos_sb_info *sbi;
   
        res = fat_fill_super(sb, data, silent, &vfat_dir_inode_operations, 1);
-       if (res) {
-               if (res == -EINVAL && !silent)
-                       printk(KERN_INFO "VFS: Can't find a valid"
-                              " VFAT filesystem on dev %s.\n", sb->s_id);
+       if (res)
                return res;
-       }
 
        sbi = MSDOS_SB(sb);