linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>,
	Andreas Dilger <adilger@dilger.ca>
Subject: Re: [PATCH] filefrag: fix minor issues with 29758d2
Date: Thu, 29 May 2014 12:42:06 -0500	[thread overview]
Message-ID: <5387716E.1030802@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1405291932200.2106@localhost.localdomain>

On 5/29/14, 12:34 PM, Lukáš Czerner wrote:
> On Thu, 29 May 2014, Eric Sandeen wrote:
> 
>> Date: Thu, 29 May 2014 12:25:17 -0500
>> From: Eric Sandeen <sandeen@redhat.com>
>> To: ext4 development <linux-ext4@vger.kernel.org>
>> Cc: Andreas Dilger <adilger@dilger.ca>
>> Subject: [PATCH] filefrag: fix minor issues with 29758d2
>>
>> 29758d2 filefrag: exit with error code if an error is hit
>>
>> introduced a couple errors; in one case it missed returning
>> a value, and in the other used a test where it needed an
>> assignment.
> 
> Looks good, although I wonder if we can just return -errno or goto
> out_close ? (same with fstat failure).

Perhaps; I was just following the style of the error handling block
before it, rather than refactoring w/ gotos and such.  :)

Going for the "small fix."

-Eric

> Thanks!
> -Lukas
> 
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/misc/filefrag.c b/misc/filefrag.c
>> index 37c4416..b2826ad 100644
>> --- a/misc/filefrag.c
>> +++ b/misc/filefrag.c
>> @@ -387,8 +387,9 @@ static int frag_report(const char *filename)
>>  	if (last_device != st.st_dev) {
>>  		if (fstatfs(fd, &fsinfo) < 0) {
>>  			close(fd);
>> +			rc = -errno;
>>  			perror("fstatfs");
>> -			return;
>> +			return rc;
>>  		}
>>  		if (verbose)
>>  			printf("Filesystem type is: %lx\n",
>> @@ -556,7 +557,7 @@ int main(int argc, char**argv)
>>  		int rc2 = frag_report(*cpp);
>>  
>>  		if (rc2 < 0 && rc == 0)
>> -			rc == rc2;
>> +			rc = rc2;
>>  	}
>>  
>>  	return rc;
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-05-29 17:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29 17:25 [PATCH] filefrag: fix minor issues with 29758d2 Eric Sandeen
2014-05-29 17:29 ` Eric Sandeen
2014-05-29 17:34 ` Lukáš Czerner
2014-05-29 17:42   ` Eric Sandeen [this message]
2014-05-29 17:40 ` [PATCH V2] filefrag: fix " Eric Sandeen
2014-05-30  6:45   ` Andreas Dilger
2014-05-30 18:10 ` [PATCH V3] filefrag: " Eric Sandeen
2014-05-30 21:03   ` Andreas Dilger
2014-06-02  1:28     ` Theodore Ts'o

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=5387716E.1030802@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@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).