diff options
author | Peter Osterlund <petero2@telia.com> | 2005-05-17 00:53:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:18 -0400 |
commit | 7baeb6a5ccab2d472679a053e64a63ac423c3a42 (patch) | |
tree | bdc3f674c4d0d82c3e6695f453eeb641a0eea5e6 /drivers/block/pktcdvd.c | |
parent | d0856009dbaf8eca2269d4129bb83940c0d95054 (diff) |
[PATCH] CDRW/DVD packet writing data corruption fix
I found a bug in the packet writing driver that could cause data
corruption. The problem arised if the driver got a write request for a
sector in a "zone" it was already working on. In that case it was supposed
to queue the write request until it was done processing earlier requests
for the same zone, and instead work on some other zone in the mean time.
However, if there was no other zone to work on, the driver would initiate
two packet_data objects for the same zone, causing unpredictable things to
happen.
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 82ccad0a7f1a..b9a6b7ad64f3 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -914,8 +914,10 @@ static int pkt_handle_queue(struct pktcdvd_device *pd) | |||
914 | bio = node->bio; | 914 | bio = node->bio; |
915 | zone = ZONE(bio->bi_sector, pd); | 915 | zone = ZONE(bio->bi_sector, pd); |
916 | list_for_each_entry(p, &pd->cdrw.pkt_active_list, list) { | 916 | list_for_each_entry(p, &pd->cdrw.pkt_active_list, list) { |
917 | if (p->sector == zone) | 917 | if (p->sector == zone) { |
918 | bio = NULL; | ||
918 | goto try_next_bio; | 919 | goto try_next_bio; |
920 | } | ||
919 | } | 921 | } |
920 | break; | 922 | break; |
921 | try_next_bio: | 923 | try_next_bio: |