drbd: don't expose failed local READ to upper layers
authorLars Ellenberg <lars.ellenberg@linbit.com>
Sat, 10 Apr 2010 00:10:09 +0000 (02:10 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 3 May 2010 20:40:16 +0000 (22:40 +0200)
fix regression introduced in 8.3.3:
 commit a9b17323f2875f5d9b132c2b476a750bf44b10c7
 Author: Lars Ellenberg <lars.ellenberg@linbit.com>
 Date:   Wed Aug 12 15:18:33 2009 +0200

     out-of-spinlock completion of master bio

 : (bio_rw(bio) == READA)
    ? read_completed_with_error
    : read_ahead_completed_with_error;

is obviously not what was intended.

No one noticed because of
 * page-cache at work,
 * local RAIDs

Impact:
Failed local READs are not retried remotely,
but errored to upper layers, causing filesystems
to remount read-only, or worse.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_worker.c

index 44bf6d11197e7bbad72f511ba36fba23747be68e..d48a1dfd7b2455cdb2b7b7f0df0af282c6c5a695 100644 (file)
@@ -235,7 +235,7 @@ void drbd_endio_pri(struct bio *bio, int error)
        if (unlikely(error)) {
                what = (bio_data_dir(bio) == WRITE)
                        ? write_completed_with_error
-                       : (bio_rw(bio) == READA)
+                       : (bio_rw(bio) == READ)
                          ? read_completed_with_error
                          : read_ahead_completed_with_error;
        } else