Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: Martin Doucha <martin.doucha@suse.com>,
	ltp@lists.linux.it, Richard Palethorpe <rpalethorpe@suse.com>
Subject: Re: [LTP] [PATCH v2] open06.c: convert to new LTP API
Date: Thu, 11 Aug 2022 10:49:21 +0200	[thread overview]
Message-ID: <YvTCkcD5heWoA+wJ@pevik> (raw)
In-Reply-To: <4729784.GXAFRqVoOG@localhost>

Hi all,

> Hi Petr,

> On Thursday, July 14, 2022 6:48:48 PM IST Petr Vorel wrote:
> > Hi Avinesh,

> > > -	if (mknod(fname, S_IFIFO | 0644, 0) == -1)
> > > -		tst_brkm(TBROK, cleanup, "mknod FAILED");
> > > +	SAFE_MKFIFO(TEMP_FIFO, 0644);
> > You changed test from mknod() to mkfifo(). May I know why?
> > It would be worth to mention the reason in the commit message.

> > Should not we keep mknod() ?
> > SAFE_MKNOD(TEMP_FIFO, S_IFIFO | 0644, 0);

> > According to man mknod(2) your change is correct:

> >        POSIX.1-2001 says: "The only portable use of mknod() is to create
> >        a FIFO-special file.  If mode is not S_IFIFO or dev is not 0, the
> >        behavior of mknod() is unspecified."  However, nowadays one
> >        should never use mknod() for this purpose; one should use
> >        mkfifo(3), a function especially defined for this purpose.

> > Also note LTP tests should test even deprecated kernel API, we *might* want to
> > test both mkfifo() and mknod() via .test_variants. But I'd like to hear the
> > input of the others, because both glibc and musl use SYS_mknod or SYS_mknodat
> > for mkfifo() implementation with very thin wrapper, thus not sure if it's worth
> > to test also mknod().
> I changed to SAFE_MKFIFO as it seemed more intuitive in this open() test,
> but yes, I should have mentioned it in the commit message.
> I have not checked the mkfifo() implementation in libraries, so please
> lmk which one to proceed with here, I will send updated version if needed.

Thinking about it twice, given mknod() / mkfifo() are used in the setup it does
not look worth to run .test_variants just for this. So, unless anybody disagrees,
it's ok to keep SAFE_MKFIFO(). I'll wait little longer before merging it (with
note of changed function in the commit message).

Kind regards,
Petr


> > Kind regards,
> > Petr


> Thanks,
> Avinesh




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

      reply	other threads:[~2022-08-11  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 12:46 [LTP] [PATCH v2] open06.c: convert to new LTP API Avinesh Kumar
2022-07-14 13:18 ` Petr Vorel
2022-07-27  7:28   ` Avinesh Kumar
2022-08-11  8:49     ` Petr Vorel [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=YvTCkcD5heWoA+wJ@pevik \
    --to=pvorel@suse.cz \
    --cc=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=martin.doucha@suse.com \
    --cc=rpalethorpe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox