Skip to content

Commit

Permalink
[PATCH] CDRW/DVD packet writing data corruption fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Osterlund authored and Linus Torvalds committed May 17, 2005
1 parent d085600 commit 7baeb6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,10 @@ static int pkt_handle_queue(struct pktcdvd_device *pd)
bio = node->bio;
zone = ZONE(bio->bi_sector, pd);
list_for_each_entry(p, &pd->cdrw.pkt_active_list, list) {
if (p->sector == zone)
if (p->sector == zone) {
bio = NULL;
goto try_next_bio;
}
}
break;
try_next_bio:
Expand Down

0 comments on commit 7baeb6a

Please sign in to comment.