All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: rbm@suse.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 4/8] Cleanup mmap17 test
Date: Tue, 25 Feb 2025 16:02:56 +0100	[thread overview]
Message-ID: <Z73boLXE2usA_-5S@yuki.lan> (raw)
In-Reply-To: <20250210-mmap_suite_refactoring-v2-4-6edea3a4363a@suse.com>

Hi!
> -/*
> - * Test mmap with MAP_FIXED_NOREPLACE flag
> +/*\
> + * [Description]

This shouldn't be there I now.

> - * We are testing the MAP_FIXED_NOREPLACE flag of mmap() syscall. To check
> + * Verify MAP_FIXED_NOREPLACE flag for the mmap() syscall and check
>   * if an attempt to mmap at an exisiting mapping fails with EEXIST.

This should be really just:

Verify that MAP_FIXED_NOREPLACE does not replace existing mapping and
fails with EEXIST.

> + * [Algorithm]
> + *
>   * The code allocates a free address by passing NULL to first mmap call
> - * Then tries to mmap with the same address using MAP_FIXED_NOREPLACE flag
> + * then tries to mmap with the same address using MAP_FIXED_NOREPLACE flag
>   * and the mapping fails as expected.

Do we really need that part? I think that the test itself is so simple
that the single sentence above describes it completely.

>   */
>  
> -#include <stdio.h>
> -#include <fcntl.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <unistd.h>
> -#include <errno.h>
> -#include <string.h>
> -#include <stdlib.h>
> -#include "lapi/mmap.h"
>  #include "tst_test.h"
>  
>  static int fd_file1;

And since you are touching the test we do not free the mapped address in
the case of -i parameter. So need to move the SAFE_MUNMAP() to the test
setup().

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2025-02-25 15:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  9:07 [LTP] [PATCH v2 0/8] Cleanup the mmap testing suite Andrea Cervesato
2025-02-10  9:07 ` [LTP] [PATCH v2 1/8] Refactor mmap03 test Andrea Cervesato
2025-02-10  9:41   ` Petr Vorel
2025-02-10 11:46     ` Ricardo B. Marlière
2025-02-24 16:56     ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 2/8] Refactor mmap10 test Andrea Cervesato
2025-02-24 16:57   ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 3/8] Cleanup mmap12 test Andrea Cervesato
2025-02-25 10:17   ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 4/8] Cleanup mmap17 test Andrea Cervesato
2025-02-25 15:02   ` Cyril Hrubis [this message]
2025-02-10  9:07 ` [LTP] [PATCH v2 5/8] Cleanup mmap18 test Andrea Cervesato
2025-02-25 15:20   ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 6/8] Cleanup mmap19 test Andrea Cervesato
2025-02-25 15:21   ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 7/8] Cleanup mmap20 test Andrea Cervesato
2025-02-25 15:21   ` Cyril Hrubis
2025-02-10  9:07 ` [LTP] [PATCH v2 8/8] Refactor mmap001 test and move it to mmap21 Andrea Cervesato
2025-02-25 15:51   ` Cyril Hrubis

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=Z73boLXE2usA_-5S@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=rbm@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.