diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /arch/sparc64/solaris/fs.c | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'arch/sparc64/solaris/fs.c')
-rw-r--r-- | arch/sparc64/solaris/fs.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 3cf5b6883..e80d6b13f 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.22 2000/07/28 12:15:02 davem Exp $ +/* $Id: fs.c,v 1.23 2000/08/29 07:01:54 davem Exp $ * fs.c: fs related syscall emulation for Solaris * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -612,20 +612,25 @@ asmlinkage int solaris_fcntl(unsigned fd, unsigned cmd, u32 arg) case SOL_F_SETLKW: cmd = F_SETLKW; break; } - get_user_ret (f.l_type, &((struct sol_flock *)A(arg))->l_type, -EFAULT); - __get_user_ret (f.l_whence, &((struct sol_flock *)A(arg))->l_whence, -EFAULT); - __get_user_ret (f.l_start, &((struct sol_flock *)A(arg))->l_start, -EFAULT); - __get_user_ret (f.l_len, &((struct sol_flock *)A(arg))->l_len, -EFAULT); - __get_user_ret (f.l_pid, &((struct sol_flock *)A(arg))->l_sysid, -EFAULT); + if (get_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) || + __get_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) || + __get_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) || + __get_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) || + __get_user (f.l_pid, &((struct sol_flock *)A(arg))->l_sysid)) + return -EFAULT; + set_fs(KERNEL_DS); ret = sys_fcntl(fd, cmd, (unsigned long)&f); set_fs(old_fs); - __put_user_ret (f.l_type, &((struct sol_flock *)A(arg))->l_type, -EFAULT); - __put_user_ret (f.l_whence, &((struct sol_flock *)A(arg))->l_whence, -EFAULT); - __put_user_ret (f.l_start, &((struct sol_flock *)A(arg))->l_start, -EFAULT); - __put_user_ret (f.l_len, &((struct sol_flock *)A(arg))->l_len, -EFAULT); - __put_user_ret (f.l_pid, &((struct sol_flock *)A(arg))->l_pid, -EFAULT); - __put_user_ret (0, &((struct sol_flock *)A(arg))->l_sysid, -EFAULT); + + if (__put_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) || + __put_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) || + __put_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) || + __put_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) || + __put_user (f.l_pid, &((struct sol_flock *)A(arg))->l_pid) || + __put_user (0, &((struct sol_flock *)A(arg))->l_sysid)) + return -EFAULT; + return ret; } case SOL_F_FREESP: @@ -634,7 +639,9 @@ asmlinkage int solaris_fcntl(unsigned fd, unsigned cmd, u32 arg) int (*sys_newftruncate)(unsigned int, unsigned long)= (int (*)(unsigned int, unsigned long))SYS(ftruncate); - get_user_ret(length, &((struct sol_flock*)A(arg))->l_start, -EFAULT); + if (get_user(length, &((struct sol_flock*)A(arg))->l_start)) + return -EFAULT; + return sys_newftruncate(fd, length); } }; |