From 59c72f3d7fcbb7540cf23752fc943307da4c2e1f Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 21 May 2012 17:30:11 +0200 Subject: [PATCH] --- yaml --- r: 310060 b: refs/heads/master c: af2f55426d1d888dcc0ba8dc9e9deb49fae38e38 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ccb88315cc65..41f95d663321 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 54c33e7f95284539e52ec2d99dcdf6efd29b247f +refs/heads/master: af2f55426d1d888dcc0ba8dc9e9deb49fae38e38 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index a7e994bb78c2..4767c0588b6e 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2386,6 +2386,9 @@ static struct file *do_last(struct nameidata *nd, struct path *path, error = -EISDIR; if (S_ISDIR(nd->inode->i_mode)) goto exit; + error = -ENOTDIR; + if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup) + goto exit; ok: if (!S_ISREG(nd->inode->i_mode)) will_truncate = 0;