From: Kemeng Shi <shikemeng@huaweicloud.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] ext4: remove unneeded check in get_dx_countlimit
Date: Tue, 24 Dec 2024 20:10:40 +0800 [thread overview]
Message-ID: <e24299f8-d60d-7760-cb33-26598f3dff69@huaweicloud.com> (raw)
In-Reply-To: <Z2VoSwYw+sFTzMx0@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
on 12/20/2024 8:51 PM, Ojaswin Mujoo wrote:
> On Thu, Dec 19, 2024 at 07:00:25PM +0800, Kemeng Shi wrote:
>> The "offset" is always non-NULL, remove unneeded NULL check of "offset".
>>
>> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
>
> Hi Kemeng,
>
> I know the current callers don't pass NULL but I think we should still
> keep the check around just in case, to avoid NULL dereferences in
> future. I don't think there's any harm in keeping it
>
Sure, no insistant on this and will drop this in next version.
Thanks,
Kemeng
> Regards,
> ojaswin
>
>> ---
>> fs/ext4/namei.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
>> index 33670cebdedc..07a1bb570deb 100644
>> --- a/fs/ext4/namei.c
>> +++ b/fs/ext4/namei.c
>> @@ -434,8 +434,7 @@ static struct dx_countlimit *get_dx_countlimit(struct inode *inode,
>> } else
>> return NULL;
>>
>> - if (offset)
>> - *offset = count_offset;
>> + *offset = count_offset;
>> return (struct dx_countlimit *)(((void *)dirent) + count_offset);
>> }
>>
>> --
>> 2.30.0
>>
>
next prev parent reply other threads:[~2024-12-24 12:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 11:00 [PATCH 0/6] Fix and cleanups to ext4 namei.c Kemeng Shi
2024-12-19 11:00 ` [PATCH 1/6] ext4: add missing brelse for bh2 in ext4_dx_add_entry Kemeng Shi
2024-12-20 12:57 ` Ojaswin Mujoo
2024-12-20 13:15 ` Markus Elfring
2024-12-24 12:11 ` Kemeng Shi
2024-12-21 7:33 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 2/6] ext4: remove unneeded bits mask in dx_get_block() Kemeng Shi
2024-12-20 1:10 ` Andreas Dilger
2024-12-24 12:09 ` Kemeng Shi
2024-12-19 11:00 ` [PATCH 3/6] ext4: remove unneeded forward declaration in namei.c Kemeng Shi
2024-12-20 12:55 ` Ojaswin Mujoo
2024-12-21 7:34 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 4/6] ext4: remove unneeded check in get_dx_countlimit Kemeng Shi
2024-12-20 12:51 ` Ojaswin Mujoo
2024-12-24 12:10 ` Kemeng Shi [this message]
2024-12-21 7:44 ` Zhang Yi
2024-12-24 12:16 ` Kemeng Shi
2024-12-19 11:00 ` [PATCH 5/6] ext4: remove unused input "inode" in ext4_find_dest_de Kemeng Shi
2024-12-21 7:45 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 6/6] ext4: calculate rec_len of ".." with correct name length 2 Kemeng Shi
2024-12-20 13:52 ` Markus Elfring
2024-12-20 20:38 ` Andreas Dilger
2024-12-24 12:15 ` Kemeng Shi
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=e24299f8-d60d-7760-cb33-26598f3dff69@huaweicloud.com \
--to=shikemeng@huaweicloud.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®