From c820289d3f32c80a3902171edb5715a128351863 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 21 May 2012 17:30:12 +0200 Subject: [PATCH] --- yaml --- r: 310061 b: refs/heads/master c: 050ac841ea90610067fec26150574be8c6077738 h: refs/heads/master i: 310059: 65c343fd8b27a8eb0efc2edf7cd4c01a0ebab7b8 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)