From: Andrew Morton <akpm@linux-foundation.org>
To: Su Hui <suhui@nfschina.com>
Cc: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
nathan@kernel.org, ndesaulniers@google.com, morbo@google.com,
justinstitt@google.com, ocfs2-devel@lists.linux.dev,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ocfs2: remove useless code in ocfs2_try_to_merge_extent
Date: Tue, 16 Jan 2024 12:09:26 -0800 [thread overview]
Message-ID: <20240116120926.3bfa87253bf5af5090bd78bd@linux-foundation.org> (raw)
In-Reply-To: <20240112042639.3948236-1-suhui@nfschina.com>
On Fri, 12 Jan 2024 12:26:40 +0800 Su Hui <suhui@nfschina.com> wrote:
> Clang static checker warning: Value stored to 'rec' is never read.
> Remove this useless code to silent this warning.
>
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -3743,8 +3743,6 @@ static int ocfs2_try_to_merge_extent(handle_t *handle,
> goto out;
> }
>
> - rec = &el->l_recs[split_index];
> -
> /*
> * Note that we don't pass split_rec here on purpose -
> * we've merged it into the rec already.
Then:
ret = ocfs2_merge_rec_left(path, handle, et, rec,
dealloc, split_index);
and ocfs2_merge_rec_left() almost immediately dereferences `rec'.
So this looks quite wrong to me.
next prev parent reply other threads:[~2024-01-16 20:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 4:26 [PATCH] ocfs2: remove useless code in ocfs2_try_to_merge_extent Su Hui
2024-01-16 20:09 ` Andrew Morton [this message]
2024-01-17 1:23 ` Su Hui
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=20240116120926.3bfa87253bf5af5090bd78bd@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark@fasheh.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=suhui@nfschina.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