public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@trained-monkey.org>
To: "Tkaczyk, Mariusz" <mariusz.tkaczyk@linux.intel.com>,
	NeilBrown <neilb@suse.de>
Cc: Nigel Croxon <ncroxon@redhat.com>,
	xni@redhat.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH V2] Fix return value from fstat calls
Date: Fri, 13 Aug 2021 15:19:35 -0400	[thread overview]
Message-ID: <bd40b084-a3ac-c003-07bb-39ad4dada4a6@trained-monkey.org> (raw)
In-Reply-To: <fe98561f-7f8f-45fa-bafa-e7f553a0f162@linux.intel.com>

On 8/13/21 3:45 AM, Tkaczyk, Mariusz wrote:
> On 13.08.2021 09:19, NeilBrown wrote:
>> On Fri, 13 Aug 2021, Tkaczyk, Mariusz wrote:
>>>
> 
>> Error handling that is buggy, or that is hard to maintain is not better
>> than nothing.  If I can't guarantee that we never pass a bad file
>> descriptor, then you cannot guarantee that the error handling has no
>> bugs.   Less code generally means less bugs.
>>
>> Any attempt to try to handle an error that should not be able to happen
>> other than crashing is fairly pointless - you cannot guess the real
>> cause, so you cannot know how to repair.  Just printing a message and
>> continuing could be as bad as not checking the error.
>> As error handling, I meant any error verification. It doesn't indicate
> that we should return status and end gracefully. exit() is elegant
> solution in this case, totally agree.

Just catching up here on this.

I totally agree that we need to work on catching errors and exiting
properly. It will also help returning error codes from this more silly
error handling cases to keep the certification people happy. This is a
much bigger job than just these checks though.

I don't think Nigel's patch is really harmful, but I don't think it adds
any real value either, without returning the actual error codes from
fstat and parsing them op the stack properly.

Jes



  reply	other threads:[~2021-08-13 19:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 15:15 [PATCH] Fix return value from fstat calls Nigel Croxon
     [not found] ` <ed1b0603-e523-6ca6-12ce-d30a85afe885@linux.intel.com>
2021-08-11 13:06   ` Tkaczyk, Mariusz
2021-08-11 19:09 ` [PATCH V2] " Nigel Croxon
2021-08-11 22:52   ` NeilBrown
     [not found]     ` <346e8651-d861-45c7-9058-68008e691b93@Canary>
2021-08-12 23:23       ` NeilBrown
2021-08-13  7:00         ` Tkaczyk, Mariusz
2021-08-13  7:19           ` NeilBrown
2021-08-13  7:45             ` Tkaczyk, Mariusz
2021-08-13 19:19               ` Jes Sorensen [this message]
2021-08-12  6:49   ` Tkaczyk, Mariusz

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=bd40b084-a3ac-c003-07bb-39ad4dada4a6@trained-monkey.org \
    --to=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=ncroxon@redhat.com \
    --cc=neilb@suse.de \
    --cc=xni@redhat.com \
    /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