linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: fix typo in link_path_walk()
@ 2016-07-04 16:48 Luis de Bethencourt
  2016-07-04 20:13 ` Omar Sandoval
  2016-07-04 20:50 ` Al Viro
  0 siblings, 2 replies; 4+ messages in thread
From: Luis de Bethencourt @ 2016-07-04 16:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, linux-fsdevel, Luis de Bethencourt

Comment documenting the path parsing in link_path_walk() has a typo, fixing
it.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---

Hello,

Noticed this typo while studying the code paths when sys_open is called.

Thanks,
Luis

 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index 32f9fe9..ade7667 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2064,7 +2064,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 		if (!*name)
 			goto OK;
 		/*
-		 * If it wasn't NUL, we know it was '/'. Skip that
+		 * If it wasn't NULL, we know it was '/'. Skip that
 		 * slash, and continue until no more slashes.
 		 */
 		do {
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfs: fix typo in link_path_walk()
  2016-07-04 16:48 [PATCH] vfs: fix typo in link_path_walk() Luis de Bethencourt
@ 2016-07-04 20:13 ` Omar Sandoval
  2016-07-04 20:50 ` Al Viro
  1 sibling, 0 replies; 4+ messages in thread
From: Omar Sandoval @ 2016-07-04 20:13 UTC (permalink / raw)
  To: Luis de Bethencourt; +Cc: linux-kernel, viro, linux-fsdevel

On Mon, Jul 04, 2016 at 05:48:53PM +0100, Luis de Bethencourt wrote:
> Comment documenting the path parsing in link_path_walk() has a typo, fixing
> it.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
> ---
> 
> Hello,
> 
> Noticed this typo while studying the code paths when sys_open is called.
> 
> Thanks,
> Luis
> 
>  fs/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index 32f9fe9..ade7667 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2064,7 +2064,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
>  		if (!*name)
>  			goto OK;
>  		/*
> -		 * If it wasn't NUL, we know it was '/'. Skip that
> +		 * If it wasn't NULL, we know it was '/'. Skip that
>  		 * slash, and continue until no more slashes.
>  		 */
>  		do {
> -- 
> 2.6.4

NUL is the ASCII '\0' character. NULL is a pointer. So NUL is correct.

-- 
Omar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfs: fix typo in link_path_walk()
  2016-07-04 16:48 [PATCH] vfs: fix typo in link_path_walk() Luis de Bethencourt
  2016-07-04 20:13 ` Omar Sandoval
@ 2016-07-04 20:50 ` Al Viro
  2016-07-05 13:37   ` Luis de Bethencourt
  1 sibling, 1 reply; 4+ messages in thread
From: Al Viro @ 2016-07-04 20:50 UTC (permalink / raw)
  To: Luis de Bethencourt; +Cc: linux-kernel, linux-fsdevel

On Mon, Jul 04, 2016 at 05:48:53PM +0100, Luis de Bethencourt wrote:
> Comment documenting the path parsing in link_path_walk() has a typo, fixing
> it.

> @@ -2064,7 +2064,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
>  		if (!*name)
>  			goto OK;
>  		/*
> -		 * If it wasn't NUL, we know it was '/'. Skip that
> +		 * If it wasn't NULL, we know it was '/'. Skip that

"If it wasn't <this>, we know it was <that>" really implies that <this> and
<that> are values possible for the same expression, doesn't it?  How could
a pointer (NULL) and a character ('/') possibly be such?

Could you explain the meaning of thus "fixed" comment?  I'm not even asking
to explain why it is correct that way, just what the hell is it supposed to
mean?

NAK, in case it's not obvious from the above...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfs: fix typo in link_path_walk()
  2016-07-04 20:50 ` Al Viro
@ 2016-07-05 13:37   ` Luis de Bethencourt
  0 siblings, 0 replies; 4+ messages in thread
From: Luis de Bethencourt @ 2016-07-05 13:37 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel, linux-fsdevel, osandov

On 04/07/16 21:50, Al Viro wrote:
> On Mon, Jul 04, 2016 at 05:48:53PM +0100, Luis de Bethencourt wrote:
>> Comment documenting the path parsing in link_path_walk() has a typo, fixing
>> it.
> 
>> @@ -2064,7 +2064,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
>>  		if (!*name)
>>  			goto OK;
>>  		/*
>> -		 * If it wasn't NUL, we know it was '/'. Skip that
>> +		 * If it wasn't NULL, we know it was '/'. Skip that
> 
> "If it wasn't <this>, we know it was <that>" really implies that <this> and
> <that> are values possible for the same expression, doesn't it?  How could
> a pointer (NULL) and a character ('/') possibly be such?
> 
> Could you explain the meaning of thus "fixed" comment?  I'm not even asking
> to explain why it is correct that way, just what the hell is it supposed to
> mean?
> 
> NAK, in case it's not obvious from the above...
> 

Hi,

I was misinformed and thought NUL was only used as an abbreviation for the Null
character, and in a sentence the full name was meant to be used. As in,
null-terminated string. I didn't mean NULL pointer, since char *name is
dereferenced in the if check.

I see now that NULL can be more ambiguous than NUL or '\0'.
Sorry about that, I should had thought better before posting.

Apologies,
Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-05 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04 16:48 [PATCH] vfs: fix typo in link_path_walk() Luis de Bethencourt
2016-07-04 20:13 ` Omar Sandoval
2016-07-04 20:50 ` Al Viro
2016-07-05 13:37   ` Luis de Bethencourt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).