Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213106
b: refs/heads/master
c: 87f7be4
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Reisner committed Oct 14, 2010
1 parent c004725 commit 754271b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1616a25493cce727d582886f162c5bb0abd87e6a
refs/heads/master: 87f7be4cf88e93069f4cc63baf2ce70fdfc59c63
3 changes: 2 additions & 1 deletion trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,8 @@ extern void resync_after_online_grow(struct drbd_conf *);
extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local);
extern int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role,
int force);
enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev);
extern enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev);
extern void drbd_try_outdate_peer_async(struct drbd_conf *mdev);
extern int drbd_khelper(struct drbd_conf *mdev, char *cmd);

/* drbd_worker.c */
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include <asm/unaligned.h>
#include <linux/drbd_tag_magic.h>
#include <linux/drbd_limits.h>
#include <linux/compiler.h>
#include <linux/kthread.h>

static unsigned short *tl_add_blob(unsigned short *, enum drbd_tags, const void *, int);
static unsigned short *tl_add_str(unsigned short *, enum drbd_tags, const char *);
Expand Down Expand Up @@ -256,6 +258,25 @@ enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev)
return nps;
}

static int _try_outdate_peer_async(void *data)
{
struct drbd_conf *mdev = (struct drbd_conf *)data;
enum drbd_disk_state nps;

nps = drbd_try_outdate_peer(mdev);
drbd_request_state(mdev, NS(pdsk, nps));

return 0;
}

void drbd_try_outdate_peer_async(struct drbd_conf *mdev)
{
struct task_struct *opa;

opa = kthread_run(_try_outdate_peer_async, mdev, "drbd%d_a_helper", mdev_to_minor(mdev));
if (IS_ERR(opa))
dev_err(DEV, "out of mem, failed to invoke fence-peer helper\n");
}

int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
{
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3747,12 +3747,8 @@ static void drbd_disconnect(struct drbd_conf *mdev)
put_ldev(mdev);
}

if (mdev->state.role == R_PRIMARY) {
if (fp >= FP_RESOURCE && mdev->state.pdsk >= D_UNKNOWN) {
enum drbd_disk_state nps = drbd_try_outdate_peer(mdev);
drbd_request_state(mdev, NS(pdsk, nps));
}
}
if (mdev->state.role == R_PRIMARY && fp >= FP_RESOURCE && mdev->state.pdsk >= D_UNKNOWN)
drbd_try_outdate_peer_async(mdev);

spin_lock_irq(&mdev->req_lock);
os = mdev->state;
Expand Down

0 comments on commit 754271b

Please sign in to comment.