Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] 2.5.50: unused code in link_path_walk()

1 view
Skip to first unread message

Matthew Wilcox

unread,
Dec 6, 2002, 11:29:55 AM12/6/02
to

@@ -700,7 +700,6 @@
if (this.name[1] != '.')
break;
follow_dotdot(&nd->mnt, &nd->dentry);
- inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
goto return_base;

seems broken to me. if follow_dotdot() changes nd->dentry (can happen!),
inode needs to be changed. look:

inode = nd->dentry->d_inode;
for(;;) {
err = exec_permission_lite(inode);
if (this.name[0] == '.') switch (this.len) {
case 2:
if (this.name[1] != '.')
break;
follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
continue;
}
}

btw, you should cc linux-fsdevel for patches to the VFS.

--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Olaf Dietsche

unread,
Dec 6, 2002, 12:19:32 PM12/6/02
to
Matthew Wilcox <wi...@debian.org> writes:

> @@ -700,7 +700,6 @@
> if (this.name[1] != '.')
> break;
> follow_dotdot(&nd->mnt, &nd->dentry);
> - inode = nd->dentry->d_inode;
> /* fallthrough */
> case 1:
> goto return_base;
>
> seems broken to me. if follow_dotdot() changes nd->dentry (can happen!),
> inode needs to be changed. look:
>
> inode = nd->dentry->d_inode;
> for(;;) {
> err = exec_permission_lite(inode);
> if (this.name[0] == '.') switch (this.len) {
> case 2:
> if (this.name[1] != '.')
> break;
> follow_dotdot(&nd->mnt, &nd->dentry);
> inode = nd->dentry->d_inode;
> /* fallthrough */
> case 1:
> continue;
> }
> }

You looked at the _first_ switch statement. You must go further down
to the _second_ switch. *There*, you don't need this assignment, AFAICS.

> btw, you should cc linux-fsdevel for patches to the VFS.

Thanks for this pointer, I'll spam linux-fsdevel in the future ;-).

Regards, Olaf.

0 new messages