lkml.org 
[lkml]   [2004]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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/
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.028 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site