From: Jens Axboe Date: Mon, 3 Jul 2023 14:20:01 +0000 (-0600) Subject: Merge branch 'improvement/fix-warnings-if-NDEBUG-enabled' of https://github.com/dpron... X-Git-Tag: fio-3.36~75 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2091760e59615146d7cce41afc8d38e6d74eda97;p=fio.git Merge branch 'improvement/fix-warnings-if-NDEBUG-enabled' of https://github.com/dpronin/fio * 'improvement/fix-warnings-if-NDEBUG-enabled' of https://github.com/dpronin/fio: fixed compiler warnings if NDEBUG enabled in test code fixed compiler warnings if NDEBUG enabled in core code --- 2091760e59615146d7cce41afc8d38e6d74eda97 diff --cc rate-submit.c index 103a80aa,bc076e86..6f6d15bd --- a/rate-submit.c +++ b/rate-submit.c @@@ -27,10 -31,13 +30,13 @@@ static void check_overlap(struct io_u * * threads as they assess overlap. */ res = pthread_mutex_lock(&overlap_check); - assert(res == 0); + if (fio_unlikely(res != 0)) { + log_err("failed to lock overlap check mutex, err: %i:%s", errno, strerror(errno)); + abort(); + } retry: - for_each_td(td, i) { + for_each_td(td) { if (td->runstate <= TD_SETTING_UP || td->runstate >= TD_FINISHING || !td->o.serialize_overlap || @@@ -41,11 -48,17 +47,17 @@@ continue; res = pthread_mutex_unlock(&overlap_check); - assert(res == 0); + if (fio_unlikely(res != 0)) { + log_err("failed to unlock overlap check mutex, err: %i:%s", errno, strerror(errno)); + abort(); + } res = pthread_mutex_lock(&overlap_check); - assert(res == 0); + if (fio_unlikely(res != 0)) { + log_err("failed to lock overlap check mutex, err: %i:%s", errno, strerror(errno)); + abort(); + } goto retry; - } + } end_for_each(); } static int io_workqueue_fn(struct submit_worker *sw, diff --cc t/read-to-pipe-async.c index 569fc62a,76c64ab9..de98d032 --- a/t/read-to-pipe-async.c +++ b/t/read-to-pipe-async.c @@@ -241,14 -257,16 +257,14 @@@ static void *writer_fn(void *data { struct writer_thread *wt = data; struct work_item *work; - unsigned int seq = 1; + int seq = 1; work = NULL; - while (!wt->thread.exit || !flist_empty(&wt->list)) { + while (!(seq < 0) && (!wt->thread.exit || !flist_empty(&wt->list))) { pthread_mutex_lock(&wt->thread.lock); - if (work) { + if (work) flist_add_tail(&work->list, &wt->done_list); - work = NULL; - } work = find_seq(wt, seq); if (work)