From nobody Sat Feb 05 08:38:12 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 85A4619AC29B for ; Sat, 5 Feb 2022 08:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JrQlm2KgNz3J2L for ; Sat, 5 Feb 2022 08:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3421BFB8 for ; Sat, 5 Feb 2022 08:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2158cCVR077501 for ; Sat, 5 Feb 2022 08:38:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2158cCTc077500 for bugs@FreeBSD.org; Sat, 5 Feb 2022 08:38:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 261731] geom_gate needs to support BIO_ORDERED Date: Sat, 05 Feb 2022 08:38:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: peterj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644050292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N9PNvl49B57vmhxTusGQlssel48Q3UG17+HQat1Kifk=; b=ax6yGZtcIiYiSMB755tCjaIufddUbvMEZ5uI7ZZmhJolBGszHYFW8ukGWjAwDlfIhsKj6H 3MW5dVvsf9Rvq6iBuJ+SMkNKQGHCGNE7vcH8FlZglKhwSlgk9qdR8UEtx0y0Ar8mncVHug eoo7S6lN+neHTqV8lEgO/qUtpbV7zc01gwyYdyAl7fGRxr7MahajXCwQOepK8jxn9TKKl2 n2Ni1F3R3koaSXIyOKuiiVvDMjbdS7MII/wPk5b1yoTOu/jnPOJ6+FVELY6IAbwGjYiE+g MV3f4yupqkUlJ081KSVS/7XMI/LU7t15+3SghSI/wknaubyno2IKZHp5IY4p6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644050292; a=rsa-sha256; cv=none; b=g/fQERjp0Cmq+nDP4ZI2KF1HC5KgLxBQJGOKXeMWrlRJxbpzeMfCc3jiNrZwGKobtu1uhc /uiTvzzqkWDwzfDqmTX21Y9Q1QLXrfpFC59lBgmIojrYQGQO6GwLcY2BgAhYd+Qgrt4ecG 8jCYnF2A0w71LB1PmhwF45TkfpO8RPp0HlYIiSpnXcj+vVk4OsPOFoDgCZyMs3iQYsF3xI g9U9qF5ulnS3htIW9rNshk8f6PHy2J1S2H5ShXxnRkLeJoCmYFrW3o8o6OWQ+71kS+3dkp RnRjxOm74X5rRQYKYN3gcSZtzYJ33QTTPDQKT77+joeOq4sUGfKr/YYIa7Lh8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261731 Bug ID: 261731 Summary: geom_gate needs to support BIO_ORDERED Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: peterj@FreeBSD.org Discussion in the thread beginning https://lists.freebsd.org/archives/freebsd-fs/2022-January/000688.html has revealed that at least UFS relies on support of BIO_ORDERED for correct operation but examination of sys/geom/gate/g_gate.c shows that geom_gate ignores BIO_ORDERED. This could lead to potential filesystem corruption. BIO_ORDERED forms a barrier on BIO operations: An operation marked with BIO_ORDERED must not be executed until all prior operations have been retir= ed and no operations after that operation can commence before the BIO_ORDERED operation has been written to stable (non-volatile) storage and retired. T= he requirement that the operation be written to stable storage means that the = flag must be forwarded to the userland daemon for handling. There are no other bio_flags that appear to need explicit support within geom_gate. Fixing this bug therefore requires: 1) An enhancement to struct g_gate_ctl_io to support passing BIO_ORDERED to userland. This could be achieved by: a) Adding a new field. This would not change the structure size on 64-b= it architectures. b) Split the existing gctl_cmd field into 2 uint16_t fields (which match= es struct bio). This would not change the structure size. c) Treating BIO_ORDERED as a flag that can be OR'd into the existing gctl_cmd field. This would not change the structure size. 2) Updating userland geom_gate clients, their network protocols and peer daemons. Within the base system, the clients are hastd, ggatec and ggatel. --=20 You are receiving this mail because: You are the assignee for the bug.=