Re: [PATCH] use S_ISDIR() in link_path_walk() to decide whether the last path component is a directory

From: viro
Date: Mon Sep 13 2004 - 11:17:02 EST


On Mon, Sep 13, 2004 at 11:49:22AM +0400, Alex Zarochentsev wrote:
> Hi,
>
> This patch does not allow open(name, O_DIRECTORY) to be successful for
> non-directories in reiser4. It replaces ->i_op->lookup != NULL "is dir" check
> for the last path component by explicit S_ISDIR(->i_mode) check.
>
> Regardless to reiser4, S_ISDIR() looks more clear there.

The only objection here is that right now we are guaranteed that cwd and
root of every task have non-NULL ->lookup(). With your patch all we have
is S_ISDIR().

So we either need to check for non-NULL ->lookup() before the beginning of
loop in link_path_walk() or split the flag in two. I would rather do the
former...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/