diff --git a/[refs] b/[refs] index 41f95d663321..9063af76655d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: af2f55426d1d888dcc0ba8dc9e9deb49fae38e38 +refs/heads/master: 050ac841ea90610067fec26150574be8c6077738 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 4767c0588b6e..90210b46b461 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -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)