From: Cengiz Can <cengiz@kernel.wtf>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: fuse: check return value of fuse_simple_request
Date: Wed, 22 Jan 2020 15:56:05 +0300 [thread overview]
Message-ID: <8024c282d1b007c45b9655ddadd20e35@kernel.wtf> (raw)
In-Reply-To: <CAJfpegtOOCVrNkSmpmMY0dVH-359jc3RqXJ7K6dzvUqxtCxBtg@mail.gmail.com>
On 2020-01-20 16:39, Miklos Szeredi wrote:
> On Mon, Jan 20, 2020 at 1:13 PM Cengiz Can <cengiz@kernel.wtf> wrote:
>>
>> In `fs/fuse/file.c` `fuse_simple_request` is used in multiple places,
>> with its return value properly checked for possible errors.
>>
>> However the usage on `fuse_file_put` ignores its return value. And the
>> following `fuse_release_end` call used hard-coded error value of `0`.
>>
>> This triggers a warning in static analyzers and such.
>>
>> I've added a variable to capture `fuse_simple_request` result and
>> passed
>> that to `fuse_release_end` instead.
>
> Which then goes on to ignore the error, so we are exactly where we
> were with some added obscurity, which will be noticed by the next
> generation of static analyzer, when you'd come up with an even more
> obscure way to ignore the error, etc... This leads to nowhere.
I got your point. Thanks for explaining.
> If this matters (not sure) then we'll need a notation to ignore the
> return value. Does casting to (void) work?
It should probably work for the sake of silencing the analyzer but I
think
it would be easier to just ignore the warning and mark is as
unimportant.
IMHO code should be as readable as possible. So not point in casting it.
If `fuse_simple_request` errors are very rare, we can ignore this patch.
Thank you
>
> Thanks,
> Miklos
--
Cengiz Can
@cengiz_io
prev parent reply other threads:[~2020-01-22 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 12:13 [PATCH] fs: fuse: check return value of fuse_simple_request Cengiz Can
2020-01-20 13:39 ` Miklos Szeredi
2020-01-22 12:56 ` Cengiz Can [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=8024c282d1b007c45b9655ddadd20e35@kernel.wtf \
--to=cengiz@kernel.wtf \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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).