[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b04634a4-1301-4f73-a6eb-05ef79954aee@linuxfoundation.org>
Date: Fri, 4 Oct 2024 12:00:14 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Advait Dhamorikar <advaitdhamorikar@...il.com>,
Steve French <sfrench@...ba.org>, Paulo Alcantara <pc@...guebit.com>,
Ronnie Sahlberg <ronniesahlberg@...il.com>,
Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>,
Bharath SM <bharathsm@...rosoft.com>, David Howells <dhowells@...hat.com>,
Enzo Matsumiya <ematsumiya@...e.de>
Cc: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org, anupnewsmail@...il.com,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] Fix logically dead code
On 10/4/24 04:30, Advait Dhamorikar wrote:
> The if condition in collect_sample: can never be satisfied
> because of a logical contradiction.
Add a better change log explaining how you found the problem.
Also your short log is missing subsystem information.
Check submitting patches document for details on how
to write shot logs and change logs.
>
> Fixes: 94ae8c3fee94 ("smb: client: compress: LZ77 code improvements cleanup")
> Signed-off-by: Advait Dhamorikar <advaitdhamorikar@...il.com>
> ---
> fs/smb/client/compress.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c
> index 63b5a55b7a57..766b4de13da7 100644
> --- a/fs/smb/client/compress.c
> +++ b/fs/smb/client/compress.c
> @@ -166,7 +166,6 @@ static int collect_sample(const struct iov_iter *iter, ssize_t max, u8 *sample)
> loff_t start = iter->xarray_start + iter->iov_offset;
> pgoff_t last, index = start / PAGE_SIZE;
> size_t len, off, foff;
> - ssize_t ret = 0;
> void *p;
> int s = 0;
>
> @@ -193,9 +192,6 @@ static int collect_sample(const struct iov_iter *iter, ssize_t max, u8 *sample)
> memcpy(&sample[s], p, len2);
> kunmap_local(p);
>
> - if (ret < 0)
> - return ret;
> -
The change itself looks good to me - unless the intent is to
check the return from kunmap_local() and take action based on
it instead of removing the conditional that checks the ret value.
> s += len2;
>
> if (len2 < SZ_2K || s >= max - SZ_2K)
thanks,
-- Shuah
Powered by blists - more mailing lists