From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] nfs05: rewrite the test, make use of new library
Date: Thu, 23 Jun 2016 14:56:55 +0300 [thread overview]
Message-ID: <576BCE87.5070403@oracle.com> (raw)
In-Reply-To: <20160622123017.GC13962@rei.lan>
Hi,
On 06/22/2016 03:30 PM, Cyril Hrubis wrote:
> Hi!
>> --- a/testcases/network/nfs/nfs_stress/Makefile
>> +++ b/testcases/network/nfs/nfs_stress/Makefile
>> @@ -19,7 +19,7 @@ top_srcdir ?= ../../../..
>> include $(top_srcdir)/include/mk/env_pre.mk
>>
>> nfs04_create_file: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>> -nfs05_make_tree: LDLIBS += -lpthread
>> +nfs05_make_tree: LDLIBS += -I../../../kernel/include -lltp -lpthread
> Hmm, shouldn't we rather include testcase.mk to get the -lltp and
> the include path?
>
> And even if we don't the -I directive should go to CPPFLAGS instead.
Agree.
>> INSTALL_TARGETS := nfs_lib.sh \
>> nfs01 \
>> diff --git a/testcases/network/nfs/nfs_stress/nfs05 b/testcases/network/nfs/nfs_stress/nfs05
>> index 0e15c8c..26977ab 100755
>> --- a/testcases/network/nfs/nfs_stress/nfs05
>> +++ b/testcases/network/nfs/nfs_stress/nfs05
>> @@ -34,8 +34,12 @@ THREAD_NUM=${THREAD_NUM:-"8"}
>> nfs_setup
> Shouldn't we check that make and gcc is installed at this point?
I'll add a check to make sure they are available.
>
>> ...
>> - }
>> +static void *thread_fn(LTP_ATTRIBUTE_UNUSED void *args)
>> +{
>> + const char prog_buf[] = "main()\n{\n\t printf(\"hello world\");\n}\n";
>> + const size_t prog_buf_size = strlen(prog_buf);
> ^
> sizeof(prog_buf) - 1
Right, we can calculate the size at compile-time.
>> +
>>
>> - dprt("pid[%d]: init_compile(): status = %d\n",
>> - gettid(), status);
>> - dprt("we are here %d\n", __LINE__);
>> - return status;
>> + SAFE_WRITE(1, fd, prog_buf, prog_buf_size);
>> + fsync(fd);
> Why do we fsync(fd) here? Isn't the whole point of this test to find a
> race conditions?
And given the fact that we have close(fd) thereafter, should make it
useless...
Thanks,
Alexey
next prev parent reply other threads:[~2016-06-23 11:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 11:27 [LTP] [PATCH 1/2] lib: add safe_gethostname() Alexey Kodanev
2016-06-16 11:27 ` [LTP] [PATCH 2/2] nfs05: rewrite the test, make use of new library Alexey Kodanev
2016-06-22 12:30 ` Cyril Hrubis
2016-06-23 11:56 ` Alexey Kodanev [this message]
2016-06-23 11:54 ` Cyril Hrubis
2016-06-23 12:38 ` Alexey Kodanev
2016-06-23 12:41 ` Cyril Hrubis
2016-06-22 12:05 ` [LTP] [PATCH 1/2] lib: add safe_gethostname() Cyril Hrubis
2016-06-23 11:58 ` Alexey Kodanev
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=576BCE87.5070403@oracle.com \
--to=alexey.kodanev@oracle.com \
--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