io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org
Subject: Re: [liburing patch] test: fix up dead code bugs
Date: Tue, 12 Nov 2019 19:00:50 -0500	[thread overview]
Message-ID: <x49a790ir0t.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <e5b2d365-cb99-7a40-f8fe-dd8b301c741b@kernel.dk> (Jens Axboe's message of "Tue, 12 Nov 2019 16:59:42 -0700")

Jens Axboe <axboe@kernel.dk> writes:

> On 11/12/19 3:47 PM, Jeff Moyer wrote:
>> Coverity pointed out some dead code.  Fix it.
>> 
>> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>> 
>> diff --git a/test/fsync.c b/test/fsync.c
>> index e6e0898..3c67190 100644
>> --- a/test/fsync.c
>> +++ b/test/fsync.c
>> @@ -96,14 +96,14 @@ static int test_barrier_fsync(struct io_uring *ring)
>>   	io_uring_sqe_set_flags(sqe, IOSQE_IO_DRAIN);
>>   
>>   	ret = io_uring_submit(ring);
>> -	if (ret < 5) {
>> -		printf("Submitted only %d\n", ret);
>> -		goto err;
>> -	} else if (ret < 0) {
>> +	if (ret < 0) {
>>   		printf("sqe submit failed\n");
>>   		if (ret == EINVAL)
>>   			printf("kernel may not support barrier fsync yet\n");
>>   		goto err;
>> +	} else if (ret < 0) {
>> +		printf("Submitted only %d\n", ret);
>> +		goto err;
>>   	}
>
> Looks like you're adding new dead code :-)

Oops!  I'll fix that up.

-Jeff


  reply	other threads:[~2019-11-13  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 23:47 [liburing patch] test: fix up dead code bugs Jeff Moyer
2019-11-12 23:59 ` Jens Axboe
2019-11-13  0:00   ` Jeff Moyer [this message]
2019-11-13  0:04 ` [liburing patch][v2] " Jeff Moyer
2019-11-13  0:14   ` Jens Axboe
2019-11-13 13:44     ` Jeff Moyer

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=x49a790ir0t.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).