Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4587593rdb; Fri, 29 Dec 2023 06:52:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjGfs3xP9Y8ebXC5Tp+vETvPzeATE9iPWanloAiQQZQSGoAxhKO6O1F0NuFI3YszJFYxFR X-Received: by 2002:a17:902:db02:b0:1d3:bc96:6c13 with SMTP id m2-20020a170902db0200b001d3bc966c13mr15533858plx.35.1703861540845; Fri, 29 Dec 2023 06:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703861540; cv=none; d=google.com; s=arc-20160816; b=cY9ZEK/sG8Ff/tVFp/4bpopeQrKVHIs1mlbg8iNgiLdLHAhmNXjI5jxAMo0bCanOu7 icWpuxUCn7NXOBADJ+F19LyqPTIfQsP5iu4tzk8oCFdLpkF5gtOETePAkT840ObuhJgk uF4PoPZVpZNGeyVtfvI153xfolcTatAYx0ZYmxlqoLF3MqhS78LfJSEfqPQXeUv9guV3 5DEf3OMptYR96JnAQPSWs/NR4RuOXROOAsmFLVJKNbmB6D/nHMG2lXkgByMZC9kE/RXx U+0PhFBtjgvqxXpY1U8yBbLIHmpS5NV+0/FNfSRCr9tohA0M43mBLnriF3fjcCi+XQek FSyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TuPgDojPHKw6CupQJwG5ikeXW8l957Szqc5prQs1GYE=; fh=4BtuBIICjbVx1qtIzLQBr8wFLJh8QeDAVqS3fzrdHyA=; b=rRkOIEhH7HdkJFkB3Muw2vCsjzIyKtuS2f/YIdRuQ5teJLCdyn5OqlgQPHiyVWeQQX hMj6ZzFFY14aqLw0pymKTYUpXRsW1V0nBU6ECGM+vuFaQvUrhBk8JbfTCd58CLsoi1ka QJLzg82WEYQ7fGqLBX9y9Ah0J+KpMBXFQAf8bc40ckIWfHx180ffJEL75O7Li73VcZM4 S0ZjvhzIVL7TGygZPvf0nAdm32pOSGi4Rr+OEPxnsKBFVOp4AW9fEgD8PZyGGCas2R/d 2c2BUtAJB7q+bP4hnbQL0NF5Bxb5/+VqMff9X7/La3SMIhTa46/HDGO3sVWFlN7UXA9B txfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="O2/kZo7k"; spf=pass (google.com: domain of linux-kernel+bounces-13124-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13124-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id pf16-20020a17090b1d9000b0028c6b3fc762si7292402pjb.155.2023.12.29.06.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 06:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13124-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="O2/kZo7k"; spf=pass (google.com: domain of linux-kernel+bounces-13124-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13124-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 74CD3284765 for ; Fri, 29 Dec 2023 14:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA32A11C9F; Fri, 29 Dec 2023 14:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="O2/kZo7k" X-Original-To: linux-kernel@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B6D911C8B; Fri, 29 Dec 2023 14:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TuPgDojPHKw6CupQJwG5ikeXW8l957Szqc5prQs1GYE=; b=O2/kZo7k8MHhbMITfFhsRHEtGN SSg362JTpWehiBgATb5XQbubnuuFcdIT5HYWMYgG/JMopjWjU3j2GAyLYm0Ktxl4fIFtdJJsUeTc2 H56iyH8WAyeRr/Gfq8HgnK1dQOVoir4xBUeaddBW9U/Lr+Jt91O1rAKyVX/Fv+VhfC/qmwSyLW0Dj MSKBoRQQqMJMRJ12NMT2Li3XHY3Qm0ljB+hZ6anHWhRIuWP0UC9W2+0ERjW3727M6fZRrWqC2nO2F S/+M6rLLRc+rNz4m9UZwegWEG1DQrqE/3CXT6zE9QnFUAXo4MsvEFRkNtnKRxC+JzM8syg0KejMtL 6hgvC5Ig==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rJEDR-006HV8-I8; Fri, 29 Dec 2023 14:52:01 +0000 Date: Fri, 29 Dec 2023 14:52:01 +0000 From: Matthew Wilcox To: Markus Elfring Cc: linux-mm@kvack.org, kernel-janitors@vger.kernel.org, Muchun Song , LKML Subject: Re: [PATCH 2/2] hugetlbfs: Improve exception handling in hugetlbfs_fill_super() Message-ID: References: <9ce3f553-24bc-4ecd-ac5e-7ba27caeff57@web.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.