diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-08-29 17:00:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-08-29 17:00:40 -0700 |
commit | 06a557f7a68e126181f09831cb2fac6f7a7f43c2 (patch) | |
tree | 068b786e9b71171605b1ba2b07284b378cf5ec91 | |
parent | c95389b4cd6a4b52af78bea706a274453e886251 (diff) | |
parent | 347e2233b7667e336d9f671f1a52dfa3f0416e2c (diff) | |
download | lwn-06a557f7a68e126181f09831cb2fac6f7a7f43c2.tar.gz lwn-06a557f7a68e126181f09831cb2fac6f7a7f43c2.zip |
Merge tag 'nfs-for-3.11-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfix from Trond Myklebust:
"Stable patch to fix a highmem-related data corruption issue on 32-bit
ARM platforms"
* tag 'nfs-for-3.11-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
SUNRPC: Fix memory corruption issue on 32-bit highmem systems
-rw-r--r-- | net/sunrpc/xdr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 75edcfad6e26..1504bb11e4f3 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -207,10 +207,13 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base, pgfrom_base -= copy; vto = kmap_atomic(*pgto); - vfrom = kmap_atomic(*pgfrom); - memmove(vto + pgto_base, vfrom + pgfrom_base, copy); + if (*pgto != *pgfrom) { + vfrom = kmap_atomic(*pgfrom); + memcpy(vto + pgto_base, vfrom + pgfrom_base, copy); + kunmap_atomic(vfrom); + } else + memmove(vto + pgto_base, vto + pgfrom_base, copy); flush_dcache_page(*pgto); - kunmap_atomic(vfrom); kunmap_atomic(vto); } while ((len -= copy) != 0); |