The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Zheng Yu <zheng.yu@northwestern.edu>,
	jfs-discussion@lists.sourceforge.net,
	Dave Kleikamp <shaggy@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Edward Adam Davis <eadavis@qq.com>,
	Jeongjun Park <aha310510@gmail.com>,
	Nihar Chaithanya <niharchaithanya@gmail.com>,
	Rand Deeb <rand.sec96@gmail.com>,
	Vasiliy Kovalev <kovalev@altlinux.org>,
	Zheng Yu <zheng.yu@northwestern.edu>
Subject: Re: [PATCH] jfs: fix metapage reference count leak in dbAllocCtl
Date: Tue, 29 Jul 2025 16:23:26 +0200	[thread overview]
Message-ID: <8d908a98-bfb1-4008-9944-c33dc035d42f@web.de> (raw)
In-Reply-To: <20250729000508.3517823-1-zheng.yu@northwestern.edu>

…
> +++ b/fs/jfs/jfs_dmap.c
> @@ -1809,8 +1809,10 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
>  			return -EIO;
>  		dp = (struct dmap *) mp->data;
>  
> -		if (dp->tree.budmin < 0)
> +		if (dp->tree.budmin < 0) {
> +			release_metapage(mp);
>  			return -EIO;
> +		}
…

Would it be a bit nicer to use an additional label for this case?

			rc = -EIO;
			goto release_metapage;


Regards,
Markus

  reply	other threads:[~2025-07-29 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29  0:05 [PATCH] jfs: fix metapage reference count leak in dbAllocCtl Zheng Yu
2025-07-29 14:23 ` Markus Elfring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-07-29  1:22 Zheng Yu
2025-07-29 13:50 ` Dave Kleikamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d908a98-bfb1-4008-9944-c33dc035d42f@web.de \
    --to=markus.elfring@web.de \
    --cc=aha310510@gmail.com \
    --cc=eadavis@qq.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=kovalev@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niharchaithanya@gmail.com \
    --cc=rand.sec96@gmail.com \
    --cc=shaggy@kernel.org \
    --cc=zheng.yu@northwestern.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox