diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2013-02-28 13:30:19 +0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-11-25 19:22:03 +0300 |
commit | 7dbb4386b90a13a7b0cab12aae184e5e04c536c3 (patch) | |
tree | 6a2d4915247505c314e8b3cceb2e1eeb45980cba /drivers/block/drbd/drbd_state.c | |
parent | f85d9f2d02cdcd1b79e00fccd667b37b251ba3ac (diff) | |
download | linux-7dbb4386b90a13a7b0cab12aae184e5e04c536c3.tar.xz |
drbd: make suspend_io() / resume_io() must be thread and recursion safe
Avoid to prematurely resume application IO: don't set/clear a single
bit, but inc/dec an atomic counter.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd/drbd_state.c')
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index f022e99f9855..5a7ef7873b67 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -1484,7 +1484,7 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device, D_ASSERT(device, current == first_peer_device(device)->connection->worker.task); /* open coded non-blocking drbd_suspend_io(device); */ - set_bit(SUSPEND_IO, &device->flags); + atomic_inc(&device->suspend_cnt); drbd_bm_lock(device, why, flags); rv = io_fn(device); |