Messages in this thread Patch in this message | | | Date | Mon, 13 Sep 2004 11:49:22 +0400 | From | Alex Zarochentsev <> | Subject | [PATCH] use S_ISDIR() in link_path_walk() to decide whether the last path component is a directory |
| |
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.
Thanks in advance.
===== fs/namei.c 1.104 vs edited ===== --- 1.104/fs/namei.c Tue Aug 10 16:59:38 2004 +++ edited/fs/namei.c Sun Sep 12 11:00:18 2004 @@ -816,7 +816,7 @@ break; if (lookup_flags & LOOKUP_DIRECTORY) { err = -ENOTDIR; - if (!inode->i_op || !inode->i_op->lookup) + if (!S_ISDIR(inode->i_mode)) break; } goto return_base; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |