diff options
author | Dan Williams <dan.j.williams@intel.com> | 2007-07-20 03:31:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 11:44:19 -0400 |
commit | eb0645a8b1f14da300f40bb9f424640cd1181fbf (patch) | |
tree | 462789626fcd1775bec80d74d19bcd68797589c8 /drivers/md | |
parent | 7c6129c68fe90a61166800b40217a850b8faee98 (diff) |
async_tx: fix kmap_atomic usage in async_memcpy
Andrew Morton:
[async_memcpy] is very wrong if both ASYNC_TX_KMAP_DST and
ASYNC_TX_KMAP_SRC can ever be set. We'll end up using the same kmap
slot for both src add dest and we get either corrupted data or a BUG.
Evgeniy Polyakov:
Btw, shouldn't it always be kmap_atomic() even if flag is not set.
That pages are usual one returned by alloc_page().
So fix the usage of kmap_atomic and kill the ASYNC_TX_KMAP_DST and
ASYNC_TX_KMAP_SRC flags.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c8dfdb302916..d90ee145effe 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -493,12 +493,12 @@ async_copy_data(int frombio, struct bio *bio, struct page *page, | |||
493 | if (frombio) | 493 | if (frombio) |
494 | tx = async_memcpy(page, bio_page, page_offset, | 494 | tx = async_memcpy(page, bio_page, page_offset, |
495 | b_offset, clen, | 495 | b_offset, clen, |
496 | ASYNC_TX_DEP_ACK | ASYNC_TX_KMAP_SRC, | 496 | ASYNC_TX_DEP_ACK, |
497 | tx, NULL, NULL); | 497 | tx, NULL, NULL); |
498 | else | 498 | else |
499 | tx = async_memcpy(bio_page, page, b_offset, | 499 | tx = async_memcpy(bio_page, page, b_offset, |
500 | page_offset, clen, | 500 | page_offset, clen, |
501 | ASYNC_TX_DEP_ACK | ASYNC_TX_KMAP_DST, | 501 | ASYNC_TX_DEP_ACK, |
502 | tx, NULL, NULL); | 502 | tx, NULL, NULL); |
503 | } | 503 | } |
504 | if (clen < len) /* hit end of page */ | 504 | if (clen < len) /* hit end of page */ |