From nobody Fri Feb 16 05:19:20 2024 X-Original-To: dev-commits-src-all@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 4TbgGK0kM2z59llP; Fri, 16 Feb 2024 05:19:21 +0000 (UTC) (envelope-from git@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 4TbgGK012tz4XHk; Fri, 16 Feb 2024 05:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708060761; 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=jKGK9h4gF2IXP+ZAah17i7klUEpi/bxUoJj2E5P2SJ0=; b=q1YuEtV2Wk53oswEBjefkMepWGifOD6YBUI7xnnTsbL0C7ZE/ogcpSrh1QnUqObTEn7xnt WVAzTi2HR2a+JT522h8ixwkV3oFpmJ4wWDFHV2tZptzTk7axkiFMNuyVKYdozsGx/j/sWJ aiJvdOEeIamHMmgeDRkNfGfFagpJ8u7sbljDsiaDfawNpyyD8E/uZVOaRFcIJE7QHHWwaf qlIEGm01zFF2RpauuUtu+ATLbaBERTMuLY7o+o3Vq5KjL4exrxH4hJRUr9IpwR5mm2oZ8d Beobx+H/zp1rhWClurudiPg8mFkqUWgoSAT8hPd1KGqvgHZ0WCiyiS56pbE2Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708060761; 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=jKGK9h4gF2IXP+ZAah17i7klUEpi/bxUoJj2E5P2SJ0=; b=eID5hQHl9LRe5VELXNkMUvKW7VQ87ckxHoXPJFSqR50FUZH9lyfa9pIKO0bJYTCSkgZTDy 1D20dJEZOxpX8akQuiNq78VP1h0vHPWD8K7nK0oom0bsXi/oIBLNIoLNMt2m7bx1j5Gtvx LVK/+j3hD9n69WAy6Mrjce0BW/IGuMtyvPe9zavdMJZB6qFkYbXVwpNUP0wo03TskVN98H +/52yHvwF+UDXOe5WYbRWPs1bpV5Y//0swEBwPgm+gPRyoM1TxMWEFvKCzZ/WWaWYKAFVS 67gUB3eyOUdDvJrmecoBq14n5bs+XYgvmNBoPVmwNMKFwUFjwzxMV/KZ545cQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708060761; a=rsa-sha256; cv=none; b=Rh88l2EY7MgOYeOf+NAtziRgx6QV/jETdMfRJdtXWTGv3F1XyIpDEJqPGLU5XchUvNKJcp Z2Ym1Bb6mI70Xn3LN0jG1Sc0kIHNIAJO1JbiOOjMuztkyShcZ1VnXE8QvmPgH1YsHuCkGF 16kdGOOVq1OguBqK54lCBYiwMGlaA23FKCbadNsdVtlMB+NWYsffAQw5KZV/oMQkM7KFUK pcb1+7tSIP8fP7cfXtn8U0Pjf6uNi6llYu2OH2s3LpNktcEA4UygBarYfHLrL+wIgBZd3m JZkj/n2KkYkk46VdC+FmzD6cFx5DPf0z2m+un1gkbVDnPDj/mQ3RsiKumcjF0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4TbgGJ69KZz1BFW; Fri, 16 Feb 2024 05:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41G5JKwO045831; Fri, 16 Feb 2024 05:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G5JKkN045828; Fri, 16 Feb 2024 05:19:20 GMT (envelope-from git) Date: Fri, 16 Feb 2024 05:19:20 GMT Message-Id: <202402160519.41G5JKkN045828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 52d7bd8c4268 - stable/14 - graid: MFC: unbreak Promise RAID1 with 4+ providers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52d7bd8c42689e44e6de4808c284b6213104b910 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=52d7bd8c42689e44e6de4808c284b6213104b910 commit 52d7bd8c42689e44e6de4808c284b6213104b910 Author: Eugene Grosbein AuthorDate: 2024-02-12 07:24:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-02-16 05:18:43 +0000 graid: MFC: unbreak Promise RAID1 with 4+ providers Fix a problem in graid implementation of Promise RAID1 created with 4+ disks. Such an array generally works fine until reboot only due to a bug in metadata writing code. Before the fix, next taste erronously created RAID1E (kind of RAID10) instead of RAID1, hence graid used wrong offsets for I/O operations. The bug did not affect Promise RAID1 arrays with 2 or 3 disks only. Reviewed by: mav (cherry picked from commit 81092e92ea5184c4eeedad58044d72cfef72dd24) --- sys/geom/raid/md_promise.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/geom/raid/md_promise.c b/sys/geom/raid/md_promise.c index 1c22c0756dfd..da2ea3d7da4e 100644 --- a/sys/geom/raid/md_promise.c +++ b/sys/geom/raid/md_promise.c @@ -1763,8 +1763,9 @@ g_raid_md_write_promise(struct g_raid_md_object *md, struct g_raid_volume *tvol, meta->total_disks = vol->v_disks_count; meta->stripe_shift = ffs(vol->v_strip_size / 1024); meta->array_width = vol->v_disks_count; - if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1 || - vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) + if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) + meta->array_width = 1; + else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; meta->total_sectors = vol->v_mediasize / 512;