mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
Linux: Handle llseek failure
If llseek fails, then we return immediately, potentially leaving the wrong address space configured for this process, and without resetting the processes saved limits. Fix this by creating a common exit point for osi_rdwr, and using it. Change-Id: Ifff8cb0155f92a4130d21828d5ee2d2a55c09195 Reviewed-on: http://gerrit.openafs.org/1155 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
a16e6f3964
commit
7a5cee30cc
@ -387,7 +387,8 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
|
||||
/* seek to the desired position. Return -1 on error. */
|
||||
if (filp->f_op->llseek) {
|
||||
if (filp->f_op->llseek(filp, (loff_t) uiop->uio_offset, 0) != uiop->uio_offset)
|
||||
return -1;
|
||||
code = -1;
|
||||
goto out;
|
||||
} else
|
||||
filp->f_pos = uiop->uio_offset;
|
||||
|
||||
@ -425,6 +426,7 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
|
||||
code = 0;
|
||||
}
|
||||
|
||||
out:
|
||||
if (uiop->uio_seg == AFS_UIOSYS)
|
||||
TO_KERNEL_SPACE();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user