From nobody Fri Feb 16 05:31:39 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 4TbgXX1VDJz59nB7; Fri, 16 Feb 2024 05:31:40 +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 4TbgXX0p40z4Yhv; Fri, 16 Feb 2024 05:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708061500; 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=RGzxuCBgbKfIrutoCr+XveJ41Fzs9xrAejGtSt4t0AM=; b=nEFZF2/2XqTDeygEne8IWTkQZQlmOAKPbDjEoM86hk7Yop5NTjCvVpbdKRgK3Zko3axOnJ CztduLS0ZlpL/IsNWRLCQKI1Ljl67PIQsu7vpJodlEinCl8TjwlD+2Dy/EsDSGoVg+oHh5 DE/kVWXYXp1KqEIhoevbvCi9i7NjivWtHj0hRFLhTyB88+soFQ1acBBfm5ZfqpGxBFGyQq BlxnBwfhYBlEAB7VoW0uIbPB3gsmaI4dOfqwOLyB0Dvhz0/9Goo/8e7TUj1lAoHC8cM+Uq 83oD35cYuV6Dd0+/Sfi5A5QDgaUkpErs9S/NCAK+ofyfhIgcqm55wiMEorvlwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708061500; 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=RGzxuCBgbKfIrutoCr+XveJ41Fzs9xrAejGtSt4t0AM=; b=nRAfRrJ/JDc4ZSXqofHemu1dRTnRJWmMYQS+zsgTJpaP+IWsJcnmIGFG9u8OBiPJEH3K6l ZEahf4MHnJOwHt/IhIgwglId820lQmNgaQqQ9T73/vxsx/5/AuXntrOfu758CcTr7oyoJL ZOJBzh56cxH9asQ/GupUE5E2egiAfLzZCiyCB1YfKnPw8j1yzlfS3D2RBI13g89AcQGnWq ShNgza+BOyVQlqZLWzg85HVu8N5o+BFDPak3sQ3EE05r8ZLgGPjFlyLv5/bAyNDuDI58Ib Y4BilrWS6QCKoHVTp8GFo25HRIIehRwRyjDF56+bXtFVMUe4gi+CfNlhgxMoLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708061500; a=rsa-sha256; cv=none; b=ZzDyrdEvUMfY5e+qi8q2jNituL4d9NXpSR7JWh4+jo2ez6b/cnNFMp4aBniid0FawPK8wQ 6qtNt5GLxZyEkjNb26pT7dIOsL8/u3Ir7TKgEofaYXY4B5kKj3XFU2UfIEdPRwiR32T/6h A5EekIUlmTDG9UYW8NgMKNuiLVfcSJt6T6YyDJj9EMWyQ886NFgIzxvHsLriiTKMcAr5xz AoRPQ4lSqnE+lvc6piG8CVmXYynp7AxS/7QIDx7EECAkF4WPv23CCWjurDzCgLogpAK7aw +7FtJ1bMl1rGK3g2/p+4XvLULyc/OeNPHsgRs+pOCpEQLevTgaOhMaSVFNb/jQ== 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 4TbgXW6ywKz1C16; Fri, 16 Feb 2024 05:31:39 +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 41G5VdfB074908; Fri, 16 Feb 2024 05:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G5VdQQ074905; Fri, 16 Feb 2024 05:31:39 GMT (envelope-from git) Date: Fri, 16 Feb 2024 05:31:39 GMT Message-Id: <202402160531.41G5VdQQ074905@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: 68bc302ed0e0 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 68bc302ed0e08d496ee1d7be3cdc9e880ed12893 Auto-Submitted: auto-generated The branch stable/12 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=68bc302ed0e08d496ee1d7be3cdc9e880ed12893 commit 68bc302ed0e08d496ee1d7be3cdc9e880ed12893 Author: Eugene Grosbein AuthorDate: 2024-02-12 07:24:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-02-16 05:31:12 +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 edbcd074184f..a7a4a3b637b6 100644 --- a/sys/geom/raid/md_promise.c +++ b/sys/geom/raid/md_promise.c @@ -1766,8 +1766,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;