Linux: Check return code from VerifyVCache in mmap

afs_linux_mmap wasn't doing anything with the return code
from afs_linux_VerifyVCache. Change the code so that it matches
the other callers of afs_linux_VerifyVCache

Change-Id: I83b949bf3b9579e5dd2e20b487862566c1d7c730
Reviewed-on: http://gerrit.openafs.org/2247
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2010-06-24 16:00:22 +01:00 committed by Derrick Brashear
parent 4c89b6417f
commit f9c9b78a2c

View File

@ -379,16 +379,18 @@ afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
/* get a validated vcache entry */
code = afs_linux_VerifyVCache(vcp, NULL);
/* Linux's Flushpage implementation doesn't use credp, so optimise
* our code to not need to crref() it */
osi_FlushPages(vcp, NULL); /* ensure stale pages are gone */
if (code == 0) {
/* Linux's Flushpage implementation doesn't use credp, so optimise
* our code to not need to crref() it */
osi_FlushPages(vcp, NULL); /* ensure stale pages are gone */
AFS_GUNLOCK();
code = generic_file_mmap(fp, vmap);
AFS_GLOCK();
if (!code)
vcp->f.states |= CMAPPED;
}
AFS_GUNLOCK();
code = generic_file_mmap(fp, vmap);
AFS_GLOCK();
if (!code)
vcp->f.states |= CMAPPED;
AFS_GUNLOCK();
return code;
}