diff options
-rw-r--r-- | drivers/infiniband/core/fmr_pool.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c index 86a3b2d401db..8926a2bd4a87 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c | |||
@@ -394,20 +394,12 @@ EXPORT_SYMBOL(ib_destroy_fmr_pool); | |||
394 | */ | 394 | */ |
395 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool) | 395 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool) |
396 | { | 396 | { |
397 | int serial; | 397 | int serial = atomic_inc_return(&pool->req_ser); |
398 | |||
399 | atomic_inc(&pool->req_ser); | ||
400 | /* | ||
401 | * It's OK if someone else bumps req_ser again here -- we'll | ||
402 | * just wait a little longer. | ||
403 | */ | ||
404 | serial = atomic_read(&pool->req_ser); | ||
405 | 398 | ||
406 | wake_up_process(pool->thread); | 399 | wake_up_process(pool->thread); |
407 | 400 | ||
408 | if (wait_event_interruptible(pool->force_wait, | 401 | if (wait_event_interruptible(pool->force_wait, |
409 | atomic_read(&pool->flush_ser) - | 402 | atomic_read(&pool->flush_ser) - serial >= 0)) |
410 | atomic_read(&pool->req_ser) >= 0)) | ||
411 | return -EINTR; | 403 | return -EINTR; |
412 | 404 | ||
413 | return 0; | 405 | return 0; |