diff options
author | Nick Piggin <npiggin@suse.de> | 2007-12-05 02:45:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-05 12:21:20 -0500 |
commit | 369b8f5a70402d9fe77006cd0044c8a3fcd08430 (patch) | |
tree | 7796820d04e7278b37e5dadeda65fe3579dd4ab2 | |
parent | 4670df831cb479ba57dd0fa0b8a9eb88cc7129be (diff) |
mm: fix XIP file writes
Writing to XIP files at a non-page-aligned offset results in data corruption
because the writes were always sent to the start of the page.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/filemap_xip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index 32132f3cd641..e233fff61b4b 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c | |||
@@ -314,7 +314,7 @@ __xip_file_write(struct file *filp, const char __user *buf, | |||
314 | fault_in_pages_readable(buf, bytes); | 314 | fault_in_pages_readable(buf, bytes); |
315 | kaddr = kmap_atomic(page, KM_USER0); | 315 | kaddr = kmap_atomic(page, KM_USER0); |
316 | copied = bytes - | 316 | copied = bytes - |
317 | __copy_from_user_inatomic_nocache(kaddr, buf, bytes); | 317 | __copy_from_user_inatomic_nocache(kaddr + offset, buf, bytes); |
318 | kunmap_atomic(kaddr, KM_USER0); | 318 | kunmap_atomic(kaddr, KM_USER0); |
319 | flush_dcache_page(page); | 319 | flush_dcache_page(page); |
320 | 320 | ||