Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: “Samir <samir@linux.ibm.com>
Cc: “Samir <samir@linux.ibm.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6] hugemmap37: Migrate truncate_sigbus_versus_oom from libhugetlbfs
Date: Wed, 06 May 2026 12:11:46 +0000	[thread overview]
Message-ID: <69fb3003.050a0220.340685.6487@mx.google.com> (raw)
In-Reply-To: <20260407050634.124265-1-samir@linux.ibm.com>

Hi Samir,

> +/*
> + * Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.
> + */

New file; please add a 2026 copyright line for yourself as the migration
author.

> +	p = SAFE_MMAP(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
> +	SAFE_FTRUNCATE(fd, 0);
> +
> +	fdx = tst_creat_unlinked(MNTPOINT, 0, 0600);
> +	totpages = SAFE_READ_MEMINFO(MEMINFO_HPAGE_FREE);
> +	q = SAFE_MMAP(NULL, totpages * hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED,
> +			fdx, 0);

If the second SAFE_MMAP (or anything between the two) aborts, p is still
mapped but cleanup() only handles fds. Move p and q to file scope and add
SAFE_MUNMAP guards in cleanup().

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2026-05-06 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07  5:06 [LTP] [PATCH v6] hugemmap37: Migrate truncate_sigbus_versus_oom from libhugetlbfs “Samir
2026-05-06 12:11 ` Andrea Cervesato via ltp [this message]

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=69fb3003.050a0220.340685.6487@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=samir@linux.ibm.com \
    /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