All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Marshall <hubcap@omnibond.com>
To: Colin King <colin.king@canonical.com>
Cc: Martin Brandenburg <martin@omnibond.com>,
	devel@lists.orangefs.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Mike Marshall <hubcap@omnibond.com>
Subject: Re: [PATCH] orangefs: remove redundant assignment to variable buffer_index
Date: Thu, 16 May 2019 12:06:31 -0400	[thread overview]
Message-ID: <CAOg9mSQt42NQu-3nwZOCGOPx45y7G8aaiDaVe4SwotGnD9iY1A@mail.gmail.com> (raw)
In-Reply-To: <20190511132700.4862-1-colin.king@canonical.com>

Hi Colin...

Thanks for the patch. Before I initialized buffer_index, Dan Williams sent
in a warning that a particular error path could try to use ibuffer_index
uninitialized. I could induce the problem he described with one
of the xfstests resulting in a crashed kernel. I will try to refactor
the code to fix the problem some other way than initializing
buffer_index in the declaration.

-Mike

On Sat, May 11, 2019 at 9:27 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable buffer_index is being initialized however this is never
> read and later it is being reassigned to a new value. The initialization
> is redundant and hence can be removed.
>
> Addresses-Coverity: ("Unused Value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/orangefs/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
> index a35c17017210..80f06ee794c5 100644
> --- a/fs/orangefs/file.c
> +++ b/fs/orangefs/file.c
> @@ -52,7 +52,7 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
>         struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
>         struct orangefs_khandle *handle = &orangefs_inode->refn.khandle;
>         struct orangefs_kernel_op_s *new_op = NULL;
> -       int buffer_index = -1;
> +       int buffer_index;
>         ssize_t ret;
>         size_t copy_amount;
>
> --
> 2.20.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Mike Marshall <hubcap@omnibond.com>
To: Colin King <colin.king@canonical.com>
Cc: Martin Brandenburg <martin@omnibond.com>,
	devel@lists.orangefs.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Mike Marshall <hubcap@omnibond.com>
Subject: Re: [PATCH] orangefs: remove redundant assignment to variable buffer_index
Date: Thu, 16 May 2019 16:06:31 +0000	[thread overview]
Message-ID: <CAOg9mSQt42NQu-3nwZOCGOPx45y7G8aaiDaVe4SwotGnD9iY1A@mail.gmail.com> (raw)
In-Reply-To: <20190511132700.4862-1-colin.king@canonical.com>

Hi Colin...

Thanks for the patch. Before I initialized buffer_index, Dan Williams sent
in a warning that a particular error path could try to use ibuffer_index
uninitialized. I could induce the problem he described with one
of the xfstests resulting in a crashed kernel. I will try to refactor
the code to fix the problem some other way than initializing
buffer_index in the declaration.

-Mike

On Sat, May 11, 2019 at 9:27 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable buffer_index is being initialized however this is never
> read and later it is being reassigned to a new value. The initialization
> is redundant and hence can be removed.
>
> Addresses-Coverity: ("Unused Value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/orangefs/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
> index a35c17017210..80f06ee794c5 100644
> --- a/fs/orangefs/file.c
> +++ b/fs/orangefs/file.c
> @@ -52,7 +52,7 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
>         struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
>         struct orangefs_khandle *handle = &orangefs_inode->refn.khandle;
>         struct orangefs_kernel_op_s *new_op = NULL;
> -       int buffer_index = -1;
> +       int buffer_index;
>         ssize_t ret;
>         size_t copy_amount;
>
> --
> 2.20.1
>

  reply	other threads:[~2019-05-16 16:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11 13:27 [PATCH] orangefs: remove redundant assignment to variable buffer_index Colin King
2019-05-11 13:27 ` Colin King
2019-05-16 16:06 ` Mike Marshall [this message]
2019-05-16 16:06   ` Mike Marshall
2019-05-21 15:03   ` Dan Carpenter
2019-05-21 15:03     ` Dan Carpenter
2019-06-25 18:55     ` Mike Marshall
2019-06-25 18:55       ` Mike Marshall
2019-06-26  6:18       ` Dan Carpenter
2019-06-26  6:18         ` Dan Carpenter
2019-06-26 14:56         ` Colin Ian King
2019-06-26 14:56           ` Colin Ian King
2019-05-21 15:01 ` Dan Carpenter
2019-05-21 15:01   ` Dan Carpenter
2019-07-28 18:04 [PATCH] orangefs: remove redundant assignment to err Colin King
2019-07-28 18:04 ` Colin King
2020-05-24 22:48 [PATCH] orangefs: remove redundant assignment to variable ret Colin King
2020-05-24 22:48 ` Colin King
2020-06-01 11:15 ` Mike Marshall
2020-06-01 11:15   ` Mike Marshall
2022-10-17 21:49 [PATCH] orangefs: remove redundant assignment to variable buffer_index Colin Ian King

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=CAOg9mSQt42NQu-3nwZOCGOPx45y7G8aaiDaVe4SwotGnD9iY1A@mail.gmail.com \
    --to=hubcap@omnibond.com \
    --cc=colin.king@canonical.com \
    --cc=devel@lists.orangefs.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@omnibond.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.