[PATCH] Really ignore kmem_cache_destroy return value
[pandora-kernel.git] / fs / befs / linuxvfs.c
index a83e889..f6676fb 100644 (file)
@@ -325,7 +325,7 @@ befs_read_inode(struct inode *inode)
        if (!bh) {
                befs_error(sb, "unable to read inode block - "
                           "inode = %lu", inode->i_ino);
-               goto unaquire_none;
+               goto unacquire_none;
        }
 
        raw_inode = (befs_inode *) bh->b_data;
@@ -334,7 +334,7 @@ befs_read_inode(struct inode *inode)
 
        if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {
                befs_error(sb, "Bad inode: %lu", inode->i_ino);
-               goto unaquire_bh;
+               goto unacquire_bh;
        }
 
        inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode);
@@ -402,17 +402,17 @@ befs_read_inode(struct inode *inode)
                befs_error(sb, "Inode %lu is not a regular file, "
                           "directory or symlink. THAT IS WRONG! BeFS has no "
                           "on disk special files", inode->i_ino);
-               goto unaquire_bh;
+               goto unacquire_bh;
        }
 
        brelse(bh);
        befs_debug(sb, "<--- befs_read_inode()");
        return;
 
-      unaquire_bh:
+      unacquire_bh:
        brelse(bh);
 
-      unaquire_none:
+      unacquire_none:
        make_bad_inode(inode);
        befs_debug(sb, "<--- befs_read_inode() - Bad inode");
        return;
@@ -446,9 +446,7 @@ befs_init_inodecache(void)
 static void
 befs_destroy_inodecache(void)
 {
-       if (kmem_cache_destroy(befs_inode_cachep))
-               printk(KERN_ERR "befs_destroy_inodecache: "
-                      "not all structures were freed\n");
+       kmem_cache_destroy(befs_inode_cachep);
 }
 
 /*
@@ -512,7 +510,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
+       /* The utf8->nls conversion won't make the final nls string bigger
+        * than the utf one, but if the string is pure ascii they'll have the
+        * same width and an extra char is needed to save the additional \0
+        */
+       int maxlen = in_len + 1;
 
        befs_debug(sb, "---> utf2nls()");
 
@@ -588,7 +590,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = 3 * in_len;
+       /* There're nls characters that will translate to 3-chars-wide UTF-8
+        * characters, a additional byte is needed to save the final \0
+        * in special cases */
+       int maxlen = (3 * in_len) + 1;
 
        befs_debug(sb, "---> nls2utf()\n");
 
@@ -761,14 +766,14 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
                printk(KERN_ERR
                       "BeFS(%s): Unable to allocate memory for private "
                       "portion of superblock. Bailing.\n", sb->s_id);
-               goto unaquire_none;
+               goto unacquire_none;
        }
        befs_sb = BEFS_SB(sb);
        memset(befs_sb, 0, sizeof(befs_sb_info));
 
        if (!parse_options((char *) data, &befs_sb->mount_opts)) {
                befs_error(sb, "cannot parse mount options");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        befs_debug(sb, "---> befs_fill_super()");
@@ -794,7 +799,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 
        if (!(bh = sb_bread(sb, sb_block))) {
                befs_error(sb, "unable to read superblock");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /* account for offset of super block on x86 */
@@ -809,20 +814,20 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
        }
 
        if (befs_load_sb(sb, disk_sb) != BEFS_OK)
-               goto unaquire_bh;
+               goto unacquire_bh;
 
        befs_dump_super_block(sb, disk_sb);
 
        brelse(bh);
 
        if (befs_check_sb(sb) != BEFS_OK)
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
 
        if( befs_sb->num_blocks > ~((sector_t)0) ) {
                befs_error(sb, "blocks count: %Lu "
                        "is larger than the host can use",
                        befs_sb->num_blocks);
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /*
@@ -838,7 +843,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
        if (!sb->s_root) {
                iput(root);
                befs_error(sb, "get root inode failed");
-               goto unaquire_priv_sbp;
+               goto unacquire_priv_sbp;
        }
 
        /* load nls library */
@@ -860,13 +865,13 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 
        return 0;
 /*****************/
-      unaquire_bh:
+      unacquire_bh:
        brelse(bh);
 
-      unaquire_priv_sbp:
+      unacquire_priv_sbp:
        kfree(sb->s_fs_info);
 
-      unaquire_none:
+      unacquire_none:
        sb->s_fs_info = NULL;
        return -EINVAL;
 }
@@ -925,18 +930,18 @@ init_befs_fs(void)
 
        err = befs_init_inodecache();
        if (err)
-               goto unaquire_none;
+               goto unacquire_none;
 
        err = register_filesystem(&befs_fs_type);
        if (err)
-               goto unaquire_inodecache;
+               goto unacquire_inodecache;
 
        return 0;
 
-unaquire_inodecache:
+unacquire_inodecache:
        befs_destroy_inodecache();
 
-unaquire_none:
+unacquire_none:
        return err;
 }