diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 171b2713d2e5..32f91383c19c 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -112,7 +112,7 @@ static void gfs2_qd_dealloc(struct rcu_head *rcu) struct gfs2_sbd *sdp = qd->qd_sbd; kmem_cache_free(gfs2_quotad_cachep, qd); - if (atomic_dec_and_test(&sdp->sd_quota_count)) + if (atomic_read(&sdp->sd_quota_count) == 0) wake_up(&sdp->sd_kill_wait); } @@ -135,6 +135,7 @@ static void gfs2_qd_dispose(struct gfs2_quota_data *qd) } gfs2_glock_put(qd->qd_gl); + atomic_dec(&sdp->sd_quota_count); call_rcu(&qd->qd_rcu, gfs2_qd_dealloc); } @@ -1501,9 +1502,8 @@ void gfs2_quota_cleanup(struct gfs2_sbd *sdp) gfs2_qd_list_dispose(&dispose); - wait_event_timeout(sdp->sd_kill_wait, - (count = atomic_read(&sdp->sd_quota_count)) == 0, - HZ * 60); + wait_event(sdp->sd_kill_wait, + (count = atomic_read(&sdp->sd_quota_count)) == 0); if (count != 0) fs_err(sdp, "%d left-over quota data objects\n", count);