diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-04-25 13:01:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-25 13:50:55 -0700 |
commit | cbc31a475a7f7748bd0a4e536533868e7cff8645 (patch) | |
tree | aef103b0ba0076988b7d5f8c967351443cb785b6 | |
parent | 5044eed48886b105a123333fe7ca97c6bd496120 (diff) | |
download | linux-3.10-cbc31a475a7f7748bd0a4e536533868e7cff8645.tar.gz linux-3.10-cbc31a475a7f7748bd0a4e536533868e7cff8645.tar.bz2 linux-3.10-cbc31a475a7f7748bd0a4e536533868e7cff8645.zip |
packet: fix error handling
The packet driver is assuming (reasonably) that the (undocumented)
request.errors is an errno. But it is in fact some mysterious bitfield. When
things go wrong we return weird positive numbers to the VFS as pointers and it
goes oops.
Thanks to William Heimbigner for reporting and diagnosis.
(It doesn't oops, but this driver still doesn't work for William)
Cc: William Heimbigner <icxcnika@mar.tar.cc>
Cc: Peter Osterlund <petero2@telia.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/block/pktcdvd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a4fb7038318..f1b9dd7d47d 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -777,7 +777,8 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * rq->cmd_flags |= REQ_QUIET; blk_execute_rq(rq->q, pd->bdev->bd_disk, rq, 0); - ret = rq->errors; + if (rq->errors) + ret = -EIO; out: blk_put_request(rq); return ret; |