Commit ed73f724 authored by Philipp Reisner's avatar Philipp Reisner

Tracking DRBD mainline

782b1ed1e3582393381e1f3f1cb80020f027ca06 Merge branch 'drbd-8.0' into drbd-8.3
80de0d362ffd9906412ce7b602db7c9cd550b678 Adjusted the drbd_congested() function to work on kernels >= 2.6.30
f484da549b3375ef7e7d9d08d5bf2c95745c8eaa Correct exapnsion of "device minor %d" statements for upper resources.
4cecefe99336e911425e390f115cf32a9036679f Fixed the res_by_minor() function
10d77c7a0d08257a19f8d67fdda3af71bf415b1d Do not do state changes on unconfigured devices (bugz 214)
706b35dc7ada32cf9cc47d331733514a52c5a820 double :: typo
3ced685cd6ae4179d77e09945a4951f4c997d2db Merge branch 'drbd-8.2' into drbd-8.3
70339fe8d52ee93696aa975b9ed14cbaa61d0e0c Merge branch 'drbd-8.0' into drbd-8.2
864141476a52d5e174dcbb03fa9f98b6da6f9689 Fixing the error code path in case the bitmap allocation failes.
8126b2adf618924c1d00407bd56b8b4f3976e198 Fault injection for the bitmap allocation
c091e4513f805f9a2118f01ee87e6ec7a419126a proc/drbd: catch uninitialized congestion flag
d30881451c988619e243d6294a899139eed1183d Preparing 8.0.16
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent f83a3788
......@@ -509,8 +509,12 @@ int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity)
if (want == have) {
D_ASSERT(b->bm_pages != NULL);
npages = b->bm_pages;
} else
npages = bm_realloc_pages(b->bm_pages, have, want);
} else {
if (FAULT_ACTIVE(mdev, DRBD_FAULT_BM_ALLOC))
npages = NULL;
else
npages = bm_realloc_pages(b->bm_pages, have, want);
}
if (!npages) {
err = -ENOMEM;
......
......@@ -152,6 +152,7 @@ enum {
DRBD_FAULT_DT_WR, /* data */
DRBD_FAULT_DT_RD,
DRBD_FAULT_DT_RA, /* data read ahead */
DRBD_FAULT_BM_ALLOC, /* bitmap allocation */
DRBD_FAULT_AL_EE, /* alloc ee */
DRBD_FAULT_MAX,
......
......@@ -792,6 +792,10 @@ int __drbd_set_state(struct drbd_conf *mdev,
ns.pdsk = DUnknown;
}
/* Clear the aftr_isp when becomming Unconfigured */
if (ns.conn == StandAlone && ns.disk == Diskless && ns.role == Secondary)
ns.aftr_isp = 0;
if (ns.conn <= Disconnecting && ns.disk == Diskless)
ns.pdsk = DUnknown;
......@@ -1215,8 +1219,11 @@ STATIC void after_state_ch(struct drbd_conf *mdev, union drbd_state_t os,
/* Terminate worker thread if we are unconfigured - it will be
restarted as needed... */
if (ns.disk == Diskless && ns.conn == StandAlone && ns.role == Secondary)
if (ns.disk == Diskless && ns.conn == StandAlone && ns.role == Secondary) {
if (os.aftr_isp != ns.aftr_isp)
resume_next_sg(mdev);
drbd_thread_stop_nowait(&mdev->worker);
}
drbd_md_sync(mdev);
}
......@@ -2856,8 +2863,8 @@ STATIC void drbd_cleanup(void)
}
/**
* drbd_congested: Returns 1<<BDI_write_congested and/or
* 1<<BDI_read_congested if we are congested. This interface is known
* drbd_congested: Returns 1<<BDI_async_congested and/or
* 1<<BDI_sync_congested if we are congested. This interface is known
* to be used by pdflush.
*/
static int drbd_congested(void *congested_data, int bdi_bits)
......@@ -2878,15 +2885,13 @@ static int drbd_congested(void *congested_data, int bdi_bits)
q = bdev_get_queue(mdev->bc->backing_bdev);
r = bdi_congested(&q->backing_dev_info, bdi_bits);
dec_local(mdev);
if (r) {
if (r)
reason = 'b';
goto out;
}
}
if (bdi_bits & (1 << BDI_write_congested) && test_bit(NET_CONGESTED, &mdev->flags)) {
r = (1 << BDI_write_congested);
reason = 'n';
if (bdi_bits & (1 << BDI_async_congested) && test_bit(NET_CONGESTED, &mdev->flags)) {
r |= (1 << BDI_async_congested);
reason = reason == 'b' ? 'a' : 'n';
}
out:
......@@ -3593,6 +3598,8 @@ _drbd_fault_str(unsigned int type) {
"Data write",
"Data read",
"Data read ahead",
"BM allocation",
"EE allocation"
};
return (type < DRBD_FAULT_MAX) ? _faults[type] : "**Unknown**";
......
......@@ -561,7 +561,7 @@ enum determin_dev_size_enum drbd_determin_dev_size(struct drbd_conf *mdev) __mus
size = drbd_bm_capacity(mdev)>>1;
if (size == 0) {
ERR("OUT OF MEMORY! "
"Could not allocate bitmap! ");
"Could not allocate bitmap!\n");
} else {
ERR("BM resizing failed. "
"Leaving size unchanged at size = %lu KB\n",
......@@ -886,13 +886,13 @@ STATIC int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
resync_lru = lc_alloc("resync", 61, sizeof(struct bm_extent), mdev);
if (!resync_lru) {
retcode = KMallocFailed;
goto fail;
goto release_bdev_fail;
}
if (!mdev->bitmap) {
if (drbd_bm_init(mdev)) {
retcode = KMallocFailed;
goto fail;
goto release_bdev_fail;
}
}
......
......@@ -215,7 +215,7 @@ STATIC int drbd_seq_show(struct seq_file *seq, void *v)
mdev->state.aftr_isp ? 'a' : '-',
mdev->state.peer_isp ? 'p' : '-',
mdev->state.user_isp ? 'u' : '-',
mdev->congestion_reason,
mdev->congestion_reason ?: '-',
mdev->send_cnt/2,
mdev->recv_cnt/2,
mdev->writ_cnt/2,
......
......@@ -1212,6 +1212,8 @@ STATIC int _drbd_resume_next(struct drbd_conf *mdev)
odev = minor_to_mdev(i);
if (!odev)
continue;
if (odev->state.conn == StandAlone && odev->state.disk == Diskless)
continue;
if (odev->state.aftr_isp) {
if (_drbd_may_sync_now(odev))
rv |= (__drbd_set_state(_NS(odev, aftr_isp, 0),
......
......@@ -114,4 +114,3 @@ static inline void drbd_plug_device(struct drbd_conf *mdev)
# undef __cond_lock
# define __cond_lock(x,c) (c)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment