]> git.michaelhowe.org Git - packages/o/openafs.git/commit
Linux: normalize error return for emulated syscalls
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 1 Jul 2010 15:38:20 +0000 (11:38 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 27 Sep 2010 15:27:39 +0000 (08:27 -0700)
commitbfd269535f032dce04c0769ac2ca97ca3753fcf9
tree31ed4e19a359a7f50e0646a501f4153a9ed3f214
parentb83ceefb2dffd082d3f7cc5b40e2d202f161ff65
Linux: normalize error return for emulated syscalls

pagsh and other code expect setpag() and pioctl() to behave like
a regular syscall or pioctl, that is to return -1 on error, with
errno set to the specific error code.
On Linux, the underlying emulation does a straight return of any
error code it gets from the ioctl, and errors are not properly
caught by the callers.

As an example, pagsh won't detect an error from setpag such as
exceeding a keyring quota limit.  With this patch, the user
will see this:

$ pagsh
setpag: Disk quota exceeded
sh-4.1$

The code in proc_afs_syscall is modified to set errno to the error
code and to set errorcode to -1 in case of error.

proc_afs_sycall is reindented while we're changing code there.

FIXES 126230

Change-Id: I945f2d28eb0ae26c7f42502c90eb2e6e95c29a58
Reviewed-on: http://gerrit.openafs.org/2770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0bc837f68a72ba1f75d940cc5dd057774d9f36bb)
Reviewed-on: http://gerrit.openafs.org/2797
src/sys/glue.c