Commit 88f6cd0c3bb5db2619103f834d4167b7d0d9899c
Committed by
Linus Torvalds
1 parent
7a238fcba0
Exists in
master
and in
7 other branches
[PATCH] uml: fix mknod
Fix UML hostfs mknod(): userspace has differernt dev_t size and encoding than kernel, so extract major/minor and reencode using glibc makedev() macro. Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 3 changed files with 4 additions and 4 deletions Side-by-side Diff
fs/hostfs/hostfs.h
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | extern int unlink_file(const char *file); |
77 | 77 | extern int do_mkdir(const char *file, int mode); |
78 | 78 | extern int do_rmdir(const char *file); |
79 | -extern int do_mknod(const char *file, int mode, int dev); | |
79 | +extern int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor); | |
80 | 80 | extern int link_file(const char *from, const char *to); |
81 | 81 | extern int do_readlink(char *file, char *buf, int size); |
82 | 82 | extern int rename_file(char *from, char *to); |
fs/hostfs/hostfs_kern.c
fs/hostfs/hostfs_user.c
... | ... | @@ -295,11 +295,11 @@ |
295 | 295 | return(0); |
296 | 296 | } |
297 | 297 | |
298 | -int do_mknod(const char *file, int mode, int dev) | |
298 | +int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor) | |
299 | 299 | { |
300 | 300 | int err; |
301 | 301 | |
302 | - err = mknod(file, mode, dev); | |
302 | + err = mknod(file, mode, makedev(major, minor)); | |
303 | 303 | if(err) return(-errno); |
304 | 304 | return(0); |
305 | 305 | } |