afs: Detect VIOCPREFETCH special case properly

Currently, afs_syscall_pioctl handles the VIOCPREFETCH pioctl as a
special case, calling into a different code path to handle
backgrounding the prefetch operation. However, we detect that we're
handling a VIOCPREFETCH operation just by looking at the lower 8 bits
of the given opcode. This means that any pioctl that ends in 0x0F will
trigger this codepath, such as if we add a 'C' or 'O' pioctl that uses
code 0x0F.

We only want to catch VIOCPREFETCH requests for this code path, so fix
the check to also check if we're processing a 'V' pioctl.

Change-Id: Ica8c2364f96aa3c8b4d2213bebd9a1e4cb6fa730
Reviewed-on: https://gerrit.openafs.org/13301
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Andrew Deason 2018-08-24 13:03:24 -05:00 committed by Benjamin Kaduk
parent 66d0f91791
commit 252b3bcc75

View File

@ -1119,7 +1119,9 @@ afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, int follow)
#endif
}
#endif /* AFS_NEED_CLIENTCONTEXT */
if ((com & 0xff) == 15) {
/* VIOCPREFETCH */
if ((com & 0xff00) >> 8 == 'V' && (com & 0xff) == 15) {
/* special case prefetch so entire pathname eval occurs in helper process.
* otherwise, the pioctl call is essentially useless */
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)