Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719597

[PATCH 16/17] drbd: abort drbd_start_resync if there is no connection

From Philipp Reisner <philipp.reisner@linbit.com>
Newsgroups linux.kernel
Subject [PATCH 16/17] drbd: abort drbd_start_resync if there is no connection
Date 2017-08-24 23:30 +0200
Message-ID <ui7Rp-3tg-41@gated-at.bofh.it> (permalink)
References <ui7Rn-3tg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Roland Kammerer <roland.kammerer@linbit.com>

This was found by a static analysis tool. While highly unlikely, be sure
to return without dereferencing the NULL pointer.

Reported-by: Shaobo <shaobo@cs.utah.edu>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index f0717a9..03471b3 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1756,6 +1756,11 @@ void drbd_start_resync(struct drbd_device *device, enum drbd_conns side)
 		return;
 	}
 
+	if (!connection) {
+		drbd_err(device, "No connection to peer, aborting!\n");
+		return;
+	}
+
 	if (!test_bit(B_RS_H_DONE, &device->flags)) {
 		if (side == C_SYNC_TARGET) {
 			/* Since application IO was locked out during C_WF_BITMAP_T and
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/17] DRBD updates Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 12/17] drbd: fix potential deadlock when trying to detach during handshake Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 04/17] drbd: Send P_NEG_ACK upon write error in protocol != C Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 03/17] drbd: add explicit plugging when submitting batches Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 05/17] drbd: mark symbols static where possible Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 02/17] drbd: change list_for_each_safe to while(list_first_entry_or_null) Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
    Re: [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Jens Axboe <axboe@kernel.dk> - 2017-08-25 19:30 +0200
      Re: [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-28 15:40 +0200
        [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-28 16:00 +0200
  [PATCH 08/17] drbd: fix potential get_ldev/put_ldev refcount imbalance during attach Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 17/17] drbd: switch from kmalloc() to kmalloc_array() Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 07/17] drbd: new disk-option disable-write-same Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 15/17] drbd: move global variables to drbd namespace and make some static Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 16/17] drbd: abort drbd_start_resync if there is no connection Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 13/17] drbd: fix race between handshake and admin disconnect/down Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200
  [PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200

csiph-web