public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] kmsg01: fix race in SEEK_SET 0 test
Date: Mon, 6 Mar 2017 09:29:35 +0100	[thread overview]
Message-ID: <20170306082934.GA23159@rei.lan> (raw)
In-Reply-To: <1967673779.3483232.1488788306768.JavaMail.zimbra@redhat.com>

Hi!
> > > +		/*
> > > +		 * Open 2 fds. Use fd1 to read seqno1, then seek to
> > > +		 * begininng and read seqno2. Use fd2 to check if
> > > +		 * first entry in buffer got overwritten. If so,
> > > +		 * we'll have to repeat the test.
> > > +		 */
> > > +		fd = SAFE_OPEN(cleanup, "/dev/kmsg", O_RDONLY | O_NONBLOCK);
> > > +		fd2 = SAFE_OPEN(cleanup, "/dev/kmsg", O_RDONLY | O_NONBLOCK);
> > > +
> > > +		if (read_msg_seqno(fd, &seqno[0]))
> > > +			goto close_fds;
> > > +
> > > +		if (lseek(fd, 0, SEEK_SET) == -1) {
> > > +			tst_resm(TFAIL|TERRNO, "SEEK_SET 0 failed");
> > > +			goto done;
> > 
> > I wonder if this should be tst_brkm() rather than tst_resm(), since as
> > it is we would end up printing the TFAIL message below, or am I
> > mistaken?
> 
> I can skip the TFAIL message below, but I find TFAIL here more fitting,
> because it is directly related to what's being tested. 

Sounds reasonable, let's go with that.

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2017-03-06  8:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  9:42 [LTP] [PATCH] kmsg01: fix race in SEEK_SET 0 test Jan Stancek
2017-03-03 14:36 ` Cyril Hrubis
2017-03-06  8:18   ` Jan Stancek
2017-03-06  8:29     ` Cyril Hrubis [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=20170306082934.GA23159@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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