]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
cache bypass: fix afs_bypass_copy_page memcpy oops
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 5 Dec 2012 23:23:34 +0000 (18:23 -0500)
committerPaul Smeddle <paul.smeddle@gmail.com>
Fri, 7 Dec 2012 12:44:43 +0000 (04:44 -0800)
The two memory copy cases were inverted when the code was
refactored, causing an oops when cache bypass is enabled.

Reviewed-on: http://gerrit.openafs.org/8617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 5b2cc290f8e991b152411168cabd1c9e7f31deb4)

Change-Id: Ia5eb577046895a2b38a6be5c4794db9a65893530
Reviewed-on: http://gerrit.openafs.org/8715
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
src/afs/afs_bypasscache.c

index 4dca01cf7a47a525fe891fa0af343498e56a81be..c8f3f7eec35ba0e4220bef1897dd6e5f50da0767 100644 (file)
@@ -320,9 +320,9 @@ afs_bypass_copy_page(bypass_page_t pp, int pageoff, struct iovec *rxiov,
     int dolen;
 
     if (partial)
-       dolen = rxiov[iovno].iov_len - iovoff;
-    else
        dolen = auio->uio_iov[curiov].iov_len - pageoff;
+    else
+       dolen = rxiov[iovno].iov_len - iovoff;
 
 #if !defined(UKERNEL)
 # if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE)