diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-18 04:38:01 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:47:53 -0500 |
commit | 194bfb32dba8345a7e0f83e9b1ee965e14d4b679 (patch) | |
tree | 7ce893e0116c4b286a55b068ffde10be18241afd /drivers/block | |
parent | 6c922ed543bee1bc6685ade07be59f3fa49a7288 (diff) |
drbd: serialize admin requests for new resync with pending bitmap io
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 42e16e4edfa3..434b621f76a9 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1873,6 +1873,10 @@ static int drbd_nl_invalidate(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl | |||
1873 | { | 1873 | { |
1874 | int retcode; | 1874 | int retcode; |
1875 | 1875 | ||
1876 | /* If there is still bitmap IO pending, probably because of a previous | ||
1877 | * resync just being finished, wait for it before requesting a new resync. */ | ||
1878 | wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); | ||
1879 | |||
1876 | retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T), CS_ORDERED); | 1880 | retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T), CS_ORDERED); |
1877 | 1881 | ||
1878 | if (retcode < SS_SUCCESS && retcode != SS_NEED_CONNECTION) | 1882 | if (retcode < SS_SUCCESS && retcode != SS_NEED_CONNECTION) |
@@ -1908,6 +1912,10 @@ static int drbd_nl_invalidate_peer(struct drbd_conf *mdev, struct drbd_nl_cfg_re | |||
1908 | { | 1912 | { |
1909 | int retcode; | 1913 | int retcode; |
1910 | 1914 | ||
1915 | /* If there is still bitmap IO pending, probably because of a previous | ||
1916 | * resync just being finished, wait for it before requesting a new resync. */ | ||
1917 | wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); | ||
1918 | |||
1911 | retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_S), CS_ORDERED); | 1919 | retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_S), CS_ORDERED); |
1912 | 1920 | ||
1913 | if (retcode < SS_SUCCESS) { | 1921 | if (retcode < SS_SUCCESS) { |
@@ -1916,7 +1924,6 @@ static int drbd_nl_invalidate_peer(struct drbd_conf *mdev, struct drbd_nl_cfg_re | |||
1916 | into a full resync. */ | 1924 | into a full resync. */ |
1917 | retcode = drbd_request_state(mdev, NS(pdsk, D_INCONSISTENT)); | 1925 | retcode = drbd_request_state(mdev, NS(pdsk, D_INCONSISTENT)); |
1918 | if (retcode >= SS_SUCCESS) { | 1926 | if (retcode >= SS_SUCCESS) { |
1919 | /* open coded drbd_bitmap_io() */ | ||
1920 | if (drbd_bitmap_io(mdev, &drbd_bmio_set_susp_al, | 1927 | if (drbd_bitmap_io(mdev, &drbd_bmio_set_susp_al, |
1921 | "set_n_write from invalidate_peer")) | 1928 | "set_n_write from invalidate_peer")) |
1922 | retcode = ERR_IO_MD_DISK; | 1929 | retcode = ERR_IO_MD_DISK; |