dect
/
linux-2.6
Archived
13
0
Fork 0

vfs: do_last(): only return EISDIR for O_CREAT

This allows this code to be shared between O_CREAT and plain opens.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Miklos Szeredi 2012-05-21 17:30:12 +02:00 committed by Al Viro
parent af2f55426d
commit 050ac841ea
1 changed files with 1 additions and 1 deletions

View File

@ -2384,7 +2384,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
if (error)
return ERR_PTR(error);
error = -EISDIR;
if (S_ISDIR(nd->inode->i_mode))
if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode))
goto exit;
error = -ENOTDIR;
if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)