From 790ca165d0c545acacf3e07f523b55d2ee44df48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edwin?= Date: Thu, 16 Jun 2011 00:06:14 +0300 Subject: [PATCH] --- yaml --- r: 253703 b: refs/heads/master c: 50338b889dc504c69e0cb316ac92d1b9e51f3c8a h: refs/heads/master i: 253701: 36fb4edbae0a8d959a6376e13c97d54933478804 253699: da2fe2aa7dba25f73e1978741b9e04664ff980c3 253695: 34ce681bf70eaae95bbdd869092a0ed979521066 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2cb693d9a253..68a6f3ce4d55 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a685e08987d1edf1995b76511d4c98ea0e905377 +refs/heads/master: 50338b889dc504c69e0cb316ac92d1b9e51f3c8a diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 9802345df5e7..6301963b161f 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2713,8 +2713,10 @@ static long do_unlinkat(int dfd, const char __user *pathname) error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { /* Why not before? Because we want correct error value */ + if (nd.last.name[nd.last.len]) + goto slashes; inode = dentry->d_inode; - if (nd.last.name[nd.last.len] || !inode) + if (!inode) goto slashes; ihold(inode); error = mnt_want_write(nd.path.mnt);