[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20120203055213.18864.9049.stgit@ltc219.sdl.hitachi.co.jp>
Date: Fri, 03 Feb 2012 14:52:13 +0900
From: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
yrl.pp-manager.tt@...achi.com,
Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>,
Alexander Viro <viro@...iv.linux.org.uk>
Subject: [RFC PATCH] vfs: return EINVAL when calling mknod(2) with S_IFDIR mode
According to a manual of mknod(2) and mknodat(2), it seems that they
should return EINVAL when called with S_IFDIR mode, although currently
they return EPERM. So, this patch changes it to EINVAL for S_IFDIR.
Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
---
fs/namei.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 208c6aa..5d7ead1 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2483,8 +2483,6 @@ static int may_mknod(umode_t mode)
case S_IFSOCK:
case 0: /* zero mode translates to S_IFREG */
return 0;
- case S_IFDIR:
- return -EPERM;
default:
return -EINVAL;
}
@@ -2498,7 +2496,7 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
int error;
if (S_ISDIR(mode))
- return -EPERM;
+ return -EINVAL;
dentry = user_path_create(dfd, filename, &path, 0);
if (IS_ERR(dentry))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists