All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] syscalls: new test writev07
Date: Thu, 6 Oct 2016 09:16:08 +0200	[thread overview]
Message-ID: <20161006071607.GA4975@rei.lan> (raw)
In-Reply-To: <1642663993.652860.1475684463479.JavaMail.zimbra@redhat.com>

Hi!
> > Hmm, we have tst_resm_hexd() in the old library exactly for this purpose
> > but it's not exported to the new library at this point. We should fix
> > that and make use of it here.
> > 
> > > +static void test_partially_valid_iovec(int initial_file_offset)
> > > +{
> > > +	int i, fd;
> > > +	unsigned char buffer[BUFSIZE], fpattern[BUFSIZE], tmp[BUFSIZE];
> > > +	long off_after;
> > > +	struct iovec wr_iovec[] = {
> > > +		{ buffer + CHUNK, CHUNK * 2 },
> > > +		{ bad_addr, CHUNK },
> > > +		{ buffer + CHUNK * 3, CHUNK },
> > > +		{ buffer + CHUNK * 2, CHUNK * 2 },
> > > +	};
> > 
> > Hmm, I fail to see the logic after the buffer and CHUNK here. Why don't
> > we start from the start of the buffer for the first iovec record?
> 
> We can, I picked random offset and lengths.
> 
> > 
> > Why is the BUFSIZE defined as CHUNK * 8 while the only CHUNK * 4 could
> > be reached here?
> 
> BUFSIZE should also be large enough to accomodate all writes combined,
> so in worst case (if bad_addr somehow worked) you need CHUNK * 6.
> I picked 8 to have some reserve. I can rework it just to CHUNK * 4 size.

Nah, just let it be. I was just wondering if there is a deeper meaning
behind these.

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2016-10-06  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 12:36 [LTP] [PATCH 1/2] syscalls: new test writev07 Jan Stancek
2016-10-05 12:36 ` [LTP] [PATCH 2/2] writev: remove old tests for partially invalid iovec Jan Stancek
2016-10-05 15:38   ` Cyril Hrubis
2016-10-05 15:23 ` [LTP] [PATCH 1/2] syscalls: new test writev07 Cyril Hrubis
2016-10-05 16:21   ` Jan Stancek
2016-10-06  7:16     ` 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=20161006071607.GA4975@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 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.