aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r--drivers/block/drbd/drbd_int.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 9a944604939f..38bbaba8bd89 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -2213,8 +2213,9 @@ static inline int drbd_get_max_buffers(struct drbd_conf *mdev)
2213 return mxb; 2213 return mxb;
2214} 2214}
2215 2215
2216static inline int drbd_state_is_stable(union drbd_state s) 2216static inline int drbd_state_is_stable(struct drbd_conf *mdev)
2217{ 2217{
2218 union drbd_state s = mdev->state;
2218 2219
2219 /* DO NOT add a default clause, we want the compiler to warn us 2220 /* DO NOT add a default clause, we want the compiler to warn us
2220 * for any newly introduced state we may have forgotten to add here */ 2221 * for any newly introduced state we may have forgotten to add here */
@@ -2233,11 +2234,7 @@ static inline int drbd_state_is_stable(union drbd_state s)
2233 case C_PAUSED_SYNC_T: 2234 case C_PAUSED_SYNC_T:
2234 case C_AHEAD: 2235 case C_AHEAD:
2235 case C_BEHIND: 2236 case C_BEHIND:
2236 /* maybe stable, look at the disk state */ 2237 /* transitional states, IO allowed */
2237 break;
2238
2239 /* no new io accepted during tansitional states
2240 * like handshake or teardown */
2241 case C_DISCONNECTING: 2238 case C_DISCONNECTING:
2242 case C_UNCONNECTED: 2239 case C_UNCONNECTED:
2243 case C_TIMEOUT: 2240 case C_TIMEOUT:
@@ -2248,7 +2245,15 @@ static inline int drbd_state_is_stable(union drbd_state s)
2248 case C_WF_REPORT_PARAMS: 2245 case C_WF_REPORT_PARAMS:
2249 case C_STARTING_SYNC_S: 2246 case C_STARTING_SYNC_S:
2250 case C_STARTING_SYNC_T: 2247 case C_STARTING_SYNC_T:
2248 break;
2249
2250 /* Allow IO in BM exchange states with new protocols */
2251 case C_WF_BITMAP_S: 2251 case C_WF_BITMAP_S:
2252 if (mdev->agreed_pro_version < 96)
2253 return 0;
2254 break;
2255
2256 /* no new io accepted in these states */
2252 case C_WF_BITMAP_T: 2257 case C_WF_BITMAP_T:
2253 case C_WF_SYNC_UUID: 2258 case C_WF_SYNC_UUID:
2254 case C_MASK: 2259 case C_MASK:
@@ -2297,7 +2302,7 @@ static inline int __inc_ap_bio_cond(struct drbd_conf *mdev)
2297 * to start during "stable" states. */ 2302 * to start during "stable" states. */
2298 2303
2299 /* no new io accepted when attaching or detaching the disk */ 2304 /* no new io accepted when attaching or detaching the disk */
2300 if (!drbd_state_is_stable(mdev->state)) 2305 if (!drbd_state_is_stable(mdev))
2301 return 0; 2306 return 0;
2302 2307
2303 /* since some older kernels don't have atomic_add_unless, 2308 /* since some older kernels don't have atomic_add_unless,