public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix sys_mknodat breakage from r/o bind mounts
@ 2007-09-25 22:58 Miklos Szeredi
  2007-09-25 23:13 ` Dave Hansen
  2007-09-26 15:03 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Miklos Szeredi @ 2007-09-25 22:58 UTC (permalink / raw)
  To: haveblue; +Cc: akpm, linux-kernel

From: Miklos Szeredi <mszeredi@suse.cz>

mknod("foo", 0644) returns EINVAL, even though it should succeed.

The responsible patch is this:

r-o-bind-mounts-sys_mknodat-elevate-write-count-for-vfs_mknod-create.patch

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---

Index: linux/fs/namei.c
===================================================================
--- linux.orig/fs/namei.c	2007-09-26 00:36:15.000000000 +0200
+++ linux/fs/namei.c	2007-09-26 00:51:19.000000000 +0200
@@ -1984,7 +1984,7 @@ asmlinkage long sys_mknodat(int dfd, con
 		goto out_dput;
 	}
 	if (!S_ISREG(mode)  && !S_ISCHR(mode)  && !S_ISBLK(mode) &&
-	    !S_ISFIFO(mode) && !S_ISSOCK(mode) && mode != 0) {
+	    !S_ISFIFO(mode) && !S_ISSOCK(mode) && (mode & S_IFMT) != 0) {
 		error = -EINVAL;
 		goto out_dput;
 	}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-26 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-25 22:58 [patch] fix sys_mknodat breakage from r/o bind mounts Miklos Szeredi
2007-09-25 23:13 ` Dave Hansen
2007-09-25 23:18   ` Miklos Szeredi
2007-09-26 15:03 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox