From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id F04E3803F6 for ; Mon, 16 Nov 2026 15:42:51 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGFfdTD027394; Mon, 16 Nov 2026 18:41:40 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGFfdTD027394 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="dSmeLxr5" Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGFfQQY027338 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 16 Nov 2026 18:41:26 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGFfQQY027338 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4b0a307487aso16968965e9.1 for ; Mon, 16 Nov 2026 07:41:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErF7xs7VFs3809/4zarSkihYfPck0tomzstAek+tZyp+UmE0pzVgHQFs/+nTTglr5cwKErnMCQ==@openvz.org X-Gm-Message-State: APuU4Z9R+vbw4QtWI6NM77LMQwUnrqo9LWp4sncGMlI7MWmeHqzttfvQ 6P8tBiDzvOYLYaUHgfahCjhVVjTdp+cmFw67GXh9Iy95cyXTDpkLyevOYAxvyBx/cbQk6KxFm18 0MizyLAIaGhfDS0728SJV7qM86/jflPaFHzQSebBT5zIUsw5AtTChag== X-Gm-Gg: AYBFou3xHLVg9NMdLNWbm76hB+CRolJckbesqBturhPUTvRCXmcfWVDfS9j3V31Bxtq JsX2z0mhIG0xoFhaDPUgnx/+KHVucUi8ihjfP69EHvPoVLdKVAzibsFiuhbqBomAzEXeMdegAPx 0L4fN2dbjMPcvrdmI4zE8K7DKV3ZTUvBUGsXb4wmSkR0jt42tjEDNPmBjJJOxps/W40JBsUuL/t O2it/NxQOnqCSuOH93U1D365ztE0HlVAj42VGQ+nc2KaUimdCS7hjiWsymVq9l2jpVedsykmZ3C JP7SBkkjIbfNh2w7tWRQ6i7o5Lu/o5FUYq6VozdEsDokgZN1CD7mMAOnlhL3ySEJqcqu4avzrWZ 6eYsXe/JE2RQPV/t4qXbC+eA4ADI7 X-Received: by 2002:a05:600c:6089:b0:4bb:76d9:f81a with SMTP id 5b1f17b1804b1-4bb76d9f83amr25363725e9.34.1794843685881; Mon, 16 Nov 2026 07:41:25 -0800 (PST) X-Received: by 2002:a05:600c:6089:b0:4bb:76d9:f81a with SMTP id 5b1f17b1804b1-4bb76d9f83amr25362915e9.34.1794843685249; Mon, 16 Nov 2026 07:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794843685; cv=none; d=google.com; s=arc-20260327; b=ksaYpGzK3ozovH6Tkmkc3HXa241N1fNYuiAfCGSxTivkEwXqXUK/yvAIOOZzlAsypl NsuJxuHJEKL/WNZraBqlfBcsKxWojblAYLW6IpTXjoPUDnHhRq3gq0oQGUzg00yYgOEK 4qARZrzzHIFWhzvKLhEvTCSIxTgU8vSiNWjzLOcaTf/s6Kp7Dv1/ztOL/FAQsTptlA3z WMXPbD6DSuSOFi61YMgbbEQrvtRFMDVAVb5WcI8XS+f7j4rZaeK8joPqYMj7h00HWDmv FYj8awR9oBHBbp9wrPgTGSAb7ttli2sl5gxj0Onp2aWFRPu0oKSKX2gb2yhdNGc12kWt iyCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=lXFKW1tAYPqnJUORJRdHrly3A20voSWR2KlITfJWek0=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=jFsCftaIr3eF8L9Unaq3KCa0aJ2FexwStUfgPZPGwcz7aw6/YoHJuiBDK0kp3ipMmW dfw6oOQHykCAaKO84YG6phdCFgjIunHlaczs2Qm8ucdxjYA47fpwB3thXrMBN6q9A3mr DqZCwMIUT5cqYLmq5kmPVMoNF1B7b05sDrKTCmAJO5tZZmNNHvB/gHo8bwOLhmSRGUPH tzbgpUgJNoMglzTgfiElrGhznqQrncd5iLsDlMXv3/I7L12VVDuATHGTpsWUaz/Q2WGs GBYouYeAVTdns4HIJeqQcLsqzdjei/rUmdzd1a4Lj0W3+b5ryP/Lb4/mWhu+Dys2hJ2I mwtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=dSmeLxr5; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-49c60115845si23265972f8f.39.2026.11.16.07.41.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 07:41:25 -0800 (PST) Received-SPF: pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=dSmeLxr5; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=lXFKW1tAYPqnJUORJRdHrly3A20voSWR2KlITfJWek0=; b=dSmeLxr5aoBi oZ29MqZyFNxMVv0f1l/sIVqY3Gss2zho4nZSA1j4SbgPzSnRMCLcLoaj4TDbAUWy0bkhvk2xItL97 4/QJBInZHHCq1eJIOtkc+415Yhd6IKfqcUygOnxlwL8vBkz4HbyhnrtM6K0PNNjG1Fj7xEwSbkDQe FgKK2bwDjBxTiWFqWjjq1LqpRJlWufsYzIdLyFi74FzwyzSEXbbhMtIT1gos4itCDmPt4B/Sy5Stp a6QwpvCzPYolRgWb9B8W1hOR4yMDzqEsFjX5dCJMFOnMVF+Y7mXxPN/nBPFOe6nAHG1EfTiXDOyFl z2Zor8w4/uPY0UizM2M/fQ==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xSylR-005tLh-2b; Mon, 16 Nov 2026 16:41:16 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Mon, 16 Nov 2026 16:41:13 +0100 Message-ID: <20261116154119.2979718-4-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261116154119.2979718-1-alexander.ivanov@virtuozzo.com> References: <20261116154119.2979718-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 3/9] drivers/md/dm-qcow2: rename the ENOSPC delay list to a held request list X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Requests that fail with ENOSPC are parked on tgt->enospc_qios and resubmitted by a timer. The same mechanism is going to hold requests failed with other errors, depending on the disk error policy, so rename enospc_qios, enospc_timer and qcow2_try_delay_enospc() to held_qios, held_timer and qcow2_try_hold_error(), and let the latter decide whether a status is to be held. Drop the WARN_ON_ONCE() for a non-write ENOSPC. A read can get ENOSPC from the read_iter of an image on FUSE, and a WARN on an error of the lower file system takes the node down with panic_on_warn. Such a read is still held, as before. No other functional change. https://virtuozzo.atlassian.net/browse/VSTOR-152175 Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Alexander Ivanov --- drivers/md/dm-qcow2-map.c | 31 ++++++++++++++++--------------- drivers/md/dm-qcow2-target.c | 16 ++++++++-------- drivers/md/dm-qcow2.h | 6 +++--- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c index 32373114580e..b987d459863d 100644 --- a/drivers/md/dm-qcow2-map.c +++ b/drivers/md/dm-qcow2-map.c @@ -4566,14 +4566,18 @@ void do_qcow2_fsync_work(struct work_struct *ws) current_restore_flags(pflags, PF_LOCAL_THROTTLE|PF_MEMALLOC_NOIO); } -static bool qcow2_try_delay_enospc(struct qcow2_target *tgt, struct qcow2_rq *qrq, struct qio *qio) +static bool qcow2_try_hold_error(struct qcow2_target *tgt, struct qcow2_rq *qrq, + struct qio *qio, blk_status_t bi_status) { - bool delayed = true; + bool held = true; unsigned long flags; + if (bi_status != BLK_STS_NOSPC) + return false; + spin_lock_irqsave(&tgt->event_lock, flags); if (unlikely(tgt->wants_suspend)) { - delayed = false; + held = false; goto unlock; } @@ -4582,15 +4586,15 @@ static bool qcow2_try_delay_enospc(struct qcow2_target *tgt, struct qcow2_rq *qr pr_err_once(QCOW2_FMT("underlying disk is almost full"), qcow2_device_name(tgt->ti)); tgt->event_enospc = true; - list_add_tail(&qio->link, &tgt->enospc_qios); + list_add_tail(&qio->link, &tgt->held_qios); unlock: spin_unlock_irqrestore(&tgt->event_lock, flags); - if (delayed) - mod_timer(&tgt->enospc_timer, jiffies + ENOSPC_TIMEOUT_JI); + if (held) + mod_timer(&tgt->held_timer, jiffies + HOLD_TIMEOUT_JI); schedule_work(&tgt->event_work); - return delayed; + return held; } static void qrq_endio(struct qcow2_target *tgt, struct qio *qio, @@ -4602,18 +4606,15 @@ static void qrq_endio(struct qcow2_target *tgt, struct qio *qio, if (qrq->bvec) kvfree(qrq->bvec); /* - * Here is exit point for rq, and here we handle ENOSPC. + * Here is exit point for rq, and here we handle errors. * Embedded qios will be reinitialized like they've just * came from upper dm level, and later resubmitted after * timeout. Note, that we do not handle merge here: merge - * callers receive -ENOSPC synchronous without intermediaries. + * callers receive errors synchronous without intermediaries. */ - if (unlikely(bi_status == BLK_STS_NOSPC)) { - WARN_ON_ONCE(!op_is_write(qio->bi_op) && - qio->bi_op != REQ_OP_FLUSH); - if (qcow2_try_delay_enospc(tgt, qrq, qio)) - return; - } + if (unlikely(bi_status != BLK_STS_OK) && + qcow2_try_hold_error(tgt, qrq, qio, bi_status)) + return; mempool_free(qrq, tgt->qrq_pool); dm_complete_request(rq, bi_status); diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c index aa0bbb6b4a97..89b12c4f971b 100644 --- a/drivers/md/dm-qcow2-target.c +++ b/drivers/md/dm-qcow2-target.c @@ -254,7 +254,7 @@ static void qcow2_tgt_destroy(struct qcow2_target *tgt) destroy_workqueue(tgt->wq); } qcow2_merge_backward_cancel(tgt); - timer_shutdown_sync(&tgt->enospc_timer); + timer_shutdown_sync(&tgt->held_timer); cancel_work_sync(&tgt->event_work); mempool_destroy(tgt->qio_pool); @@ -480,14 +480,14 @@ static void inflight_ref_exit1(struct percpu_ref *ref) complete(&tgt->inflight_ref_comp); } -static void qcow2_enospc_timer(struct timer_list *timer) +static void qcow2_held_timer(struct timer_list *timer) { - struct qcow2_target *tgt = timer_container_of(tgt, timer, enospc_timer); + struct qcow2_target *tgt = timer_container_of(tgt, timer, held_timer); unsigned long flags; LIST_HEAD(list); spin_lock_irqsave(&tgt->event_lock, flags); - list_splice_init(&tgt->enospc_qios, &list); + list_splice_init(&tgt->held_qios, &list); spin_unlock_irqrestore(&tgt->event_lock, flags); qcow2_submit_embedded_qios(tgt, &list); @@ -542,8 +542,8 @@ static struct qcow2_target *alloc_qcow2_target(struct dm_target *ti) init_rwsem(&tgt->seek_rwsem); init_waitqueue_head(&tgt->service_wq); INIT_WORK(&tgt->event_work, qcow2_event_work); - INIT_LIST_HEAD(&tgt->enospc_qios); - timer_setup(&tgt->enospc_timer, qcow2_enospc_timer, 0); + INIT_LIST_HEAD(&tgt->held_qios); + timer_setup(&tgt->held_timer, qcow2_held_timer, 0); ti->private = tgt; tgt->ti = ti; @@ -1165,8 +1165,8 @@ static void qcow2_presuspend(struct dm_target *ti) qcow2_set_service_operations(ti, false); qcow2_set_wants_suspend(ti, true); - timer_delete_sync(&tgt->enospc_timer); - qcow2_enospc_timer(&tgt->enospc_timer); + timer_delete_sync(&tgt->held_timer); + qcow2_held_timer(&tgt->held_timer); } static void qcow2_presuspend_undo(struct dm_target *ti) { diff --git a/drivers/md/dm-qcow2.h b/drivers/md/dm-qcow2.h index 3f1d5b5eef26..ea6bc6258cb0 100644 --- a/drivers/md/dm-qcow2.h +++ b/drivers/md/dm-qcow2.h @@ -19,7 +19,7 @@ #define MIN_QIOS 512 #define WB_TIMEOUT_JI (60 * HZ) -#define ENOSPC_TIMEOUT_JI (20 * HZ) +#define HOLD_TIMEOUT_JI (20 * HZ) #define PREALLOC_SIZE (128ULL * 1024 * 1024) struct QCowHeader { @@ -213,8 +213,8 @@ struct qcow2_target { atomic_t service_qios; struct wait_queue_head service_wq; - struct list_head enospc_qios; /* Delayed after ENOSPC */ - struct timer_list enospc_timer; + struct list_head held_qios; /* Failed, waiting for resubmission */ + struct timer_list held_timer; struct work_struct event_work; spinlock_t event_lock; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel