drbd: Only downgrade the disk state in case of disk failures
authorPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 14 Mar 2011 10:54:47 +0000 (11:54 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 24 May 2011 08:05:48 +0000 (10:05 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_int.h

index 2c38752ca8d637034fc597ea2cbeb6a5ae371054..5c994739d11e3248625e00268d4607f23f2330f0 100644 (file)
@@ -1827,7 +1827,8 @@ static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, int forcedetach,
                if (!forcedetach) {
                        if (__ratelimit(&drbd_ratelimit_state))
                                dev_err(DEV, "Local IO failed in %s.\n", where);
-                       _drbd_set_state(_NS(mdev, disk, D_INCONSISTENT), CS_HARD, NULL);
+                       if (mdev->state.disk > D_INCONSISTENT)
+                               _drbd_set_state(_NS(mdev, disk, D_INCONSISTENT), CS_HARD, NULL);
                        break;
                }
                /* NOTE fall through to detach case if forcedetach set */