diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 4767c0588b6e..90210b46b461 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2384,7 +2384,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, | |||
2384 | if (error) | 2384 | if (error) |
2385 | return ERR_PTR(error); | 2385 | return ERR_PTR(error); |
2386 | error = -EISDIR; | 2386 | error = -EISDIR; |
2387 | if (S_ISDIR(nd->inode->i_mode)) | 2387 | if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode)) |
2388 | goto exit; | 2388 | goto exit; |
2389 | error = -ENOTDIR; | 2389 | error = -ENOTDIR; |
2390 | if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup) | 2390 | if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup) |