drbd: Do not segfault if a sync dependency reaches a diskless device
authorPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 28 Mar 2011 12:48:01 +0000 (14:48 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:44:58 +0000 (16:44 +0100)
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 cbbc5c7cbef4fca3035e02ad6d78d7f3f36cd079..c3d1f5f5853a8bb41fd869e21e03d97bb20c9ca2 100644 (file)
@@ -1319,6 +1319,8 @@ static int _drbd_may_sync_now(struct drbd_conf *mdev)
        struct drbd_conf *odev = mdev;
 
        while (1) {
+               if (!odev->ldev)
+                       return 1;
                if (odev->ldev->dc.resync_after == -1)
                        return 1;
                odev = minor_to_mdev(odev->ldev->dc.resync_after);