[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZY7dEbRJb1dHkQPd@casper.infradead.org>
Date: Fri, 29 Dec 2023 14:52:01 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-mm@...ck.org, kernel-janitors@...r.kernel.org,
Muchun Song <muchun.song@...ux.dev>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] hugetlbfs: Improve exception handling in
hugetlbfs_fill_super()
On Fri, Dec 29, 2023 at 12:40:12PM +0100, Markus Elfring wrote:
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 24401a5046dd..5687ec574dc4 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -1483,7 +1483,7 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc)
> ctx->max_hpages,
> ctx->min_hpages);
> if (!sbinfo->spool)
> - goto out_free;
> + goto free_sbinfo;
> }
> sb->s_maxbytes = MAX_LFS_FILESIZE;
> sb->s_blocksize = huge_page_size(ctx->hstate);
> @@ -1499,10 +1499,12 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc)
> sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
> sb->s_root = d_make_root(hugetlbfs_get_root(sb, ctx));
> if (!sb->s_root)
> - goto out_free;
> + goto free_spool;
> return 0;
> -out_free:
> +
> +free_spool:
> kfree(sbinfo->spool);
> +free_sbinfo:
> kfree(sbinfo);
> return -ENOMEM;
> }
This is more complex. NACK.
Powered by blists - more mailing lists