f2fs: clean up error path of fill_super
authorChao Yu <yuchao0@huawei.com>
Wed, 17 Jan 2018 08:31:35 +0000 (16:31 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jan 2018 22:56:50 +0000 (14:56 -0800)
This patch cleans up error path of fille_super to avoid unneeded
release step.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 2bfd098..8173ae6 100644 (file)
@@ -2604,14 +2604,14 @@ try_onemore:
 
        err = init_percpu_info(sbi);
        if (err)
-               goto free_options;
+               goto free_bio_info;
 
        if (F2FS_IO_SIZE(sbi) > 1) {
                sbi->write_io_dummy =
                        mempool_create_page_pool(2 * (F2FS_IO_SIZE(sbi) - 1), 0);
                if (!sbi->write_io_dummy) {
                        err = -ENOMEM;
-                       goto free_options;
+                       goto free_percpu;
                }
        }
 
@@ -2843,10 +2843,12 @@ free_meta_inode:
        iput(sbi->meta_inode);
 free_io_dummy:
        mempool_destroy(sbi->write_io_dummy);
-free_options:
+free_percpu:
+       destroy_percpu_info(sbi);
+free_bio_info:
        for (i = 0; i < NR_PAGE_TYPE; i++)
                kfree(sbi->write_io[i]);
-       destroy_percpu_info(sbi);
+free_options:
 #ifdef CONFIG_QUOTA
        for (i = 0; i < MAXQUOTAS; i++)
                kfree(sbi->s_qf_names[i]);