소스 검색

dm: fix REQ_RAHEAD handling

A few (but not all) dm targets use a special EWOULDBLOCK error code for
failing REQ_RAHEAD requests that fail due to a lack of available resources.
But no one else knows about this magic code, and lower level drivers also
don't generate it when failing read-ahead requests for similar reasons.

So remove this special casing and ignore all additional error handling for
REQ_RAHEAD - if this was a real underlying error we'd get a normal read
once the real read comes in.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Christoph Hellwig 8 년 전
부모
커밋
9966afaf91
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      drivers/md/dm-raid1.c
  2. 1 1
      drivers/md/dm-stripe.c

+ 2 - 2
drivers/md/dm-raid1.c

@@ -1214,7 +1214,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
 	 */
 	 */
 	if (!r || (r == -EWOULDBLOCK)) {
 	if (!r || (r == -EWOULDBLOCK)) {
 		if (bio->bi_opf & REQ_RAHEAD)
 		if (bio->bi_opf & REQ_RAHEAD)
-			return -EWOULDBLOCK;
+			return -EIO;
 
 
 		queue_bio(ms, bio, rw);
 		queue_bio(ms, bio, rw);
 		return DM_MAPIO_SUBMITTED;
 		return DM_MAPIO_SUBMITTED;
@@ -1258,7 +1258,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
 	if (error == -EOPNOTSUPP)
 	if (error == -EOPNOTSUPP)
 		return error;
 		return error;
 
 
-	if ((error == -EWOULDBLOCK) && (bio->bi_opf & REQ_RAHEAD))
+	if (bio->bi_opf & REQ_RAHEAD)
 		return error;
 		return error;
 
 
 	if (unlikely(error)) {
 	if (unlikely(error)) {

+ 1 - 1
drivers/md/dm-stripe.c

@@ -384,7 +384,7 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
 	if (!error)
 	if (!error)
 		return 0; /* I/O complete */
 		return 0; /* I/O complete */
 
 
-	if ((error == -EWOULDBLOCK) && (bio->bi_opf & REQ_RAHEAD))
+	if (bio->bi_opf & REQ_RAHEAD)
 		return error;
 		return error;
 
 
 	if (error == -EOPNOTSUPP)
 	if (error == -EOPNOTSUPP)