2010-12-08 16:32:44

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH] ext4: fix typo in ext4_find_entry()

There should be a check for NUL character instead of '0'.

Reported-by: Phil Carmody <[email protected]>
Signed-off-by: Aaro Koskinen <[email protected]>
---
fs/ext4/namei.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 92203b8..dc40e75 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -872,7 +872,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
if (namelen > EXT4_NAME_LEN)
return NULL;
if ((namelen <= 2) && (name[0] == '.') &&
- (name[1] == '.' || name[1] == '0')) {
+ (name[1] == '.' || name[1] == '\0')) {
/*
* "." or ".." will only be in the first block
* NFS may look up ".."; "." should be handled by the VFS
--
1.5.6.5



2010-12-08 17:53:19

by Eric Sandeen

[permalink] [raw]
Subject: Re: [PATCH] ext4: fix typo in ext4_find_entry()

On 12/08/2010 10:33 AM, Aaro Koskinen wrote:
> There should be a check for NUL character instead of '0'.
>
> Reported-by: Phil Carmody <[email protected]>
> Signed-off-by: Aaro Koskinen <[email protected]>
> ---
> fs/ext4/namei.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index 92203b8..dc40e75 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -872,7 +872,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
> if (namelen > EXT4_NAME_LEN)
> return NULL;
> if ((namelen <= 2) && (name[0] == '.') &&
> - (name[1] == '.' || name[1] == '0')) {
> + (name[1] == '.' || name[1] == '\0')) {
> /*
> * "." or ".." will only be in the first block
> * NFS may look up ".."; "." should be handled by the VFS

Yep, as it was reviewed on the list when originally sent, oops! ;)

-Eric

2010-12-16 13:46:26

by Roman Borisov

[permalink] [raw]
Subject: Re: [PATCH] ext4: fix typo in ext4_find_entry()

On 12/08/2010 08:53 PM, ext Eric Sandeen wrote:
> On 12/08/2010 10:33 AM, Aaro Koskinen wrote:
>> There should be a check for NUL character instead of '0'.
>>
>> Reported-by: Phil Carmody<[email protected]>
>> Signed-off-by: Aaro Koskinen<[email protected]>
>> ---
>> fs/ext4/namei.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
>> index 92203b8..dc40e75 100644
>> --- a/fs/ext4/namei.c
>> +++ b/fs/ext4/namei.c
>> @@ -872,7 +872,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
>> if (namelen> EXT4_NAME_LEN)
>> return NULL;
>> if ((namelen<= 2)&& (name[0] == '.')&&
>> - (name[1] == '.' || name[1] == '0')) {
>> + (name[1] == '.' || name[1] == '\0')) {
>> /*
>> * "." or ".." will only be in the first block
>> * NFS may look up ".."; "." should be handled by the VFS
>
> Yep, as it was reviewed on the list when originally sent, oops! ;)
>
> -Eric

Hi,

the same fix should be done for ext3 patch which is planned to be in
mainline: http://www.spinics.net/lists/linux-ext4/msg21215.html

Roman