From nobody Mon Feb 12 08:02:03 2024 X-Original-To: dev-commits-src-main@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 4TYH3w0llnz59m6S; Mon, 12 Feb 2024 08:02:04 +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 4TYH3v5BlJz46kP; Mon, 12 Feb 2024 08:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707724923; 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=YXz/LWHiouEfSP8rxIkvmIj01fPJzb2gnfzz2mF0oSk=; b=AlyUht6YUNAqf913g+4mqFbrUX8oW/+M8ba43PuuAHOGfZyp6KPCZZzeycfh4yfVAxH4dA Ut4F9OrGGaCVx4u/TVZFWYO9GJ+MnF2e5zRwUF8oPPYzaLEBVvda3W7/CHf9urN92SGzUM jGN8WgkImB2JWOw0N4IKcDY84HGrgRp7CLAoJqJfHjkKvwVNfFSL56tcPNRy1T7qRXVHaD GyT3LoJX99QNlyqQZlEwRY65VrnNE2L32rOam/4B50wQ4oXUXCo31Wk+jKPOKH4zSpefkN 3UnSp/b2RxjEBRMCygttE6wSOj2SdSTNFoXvbTDatErrg4Nd76WFWIV7VPG5RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707724923; a=rsa-sha256; cv=none; b=Ratba8Qm7xvtmpNcEjOkiZIeADmOShFBkZdCaa9syoKekyPA20FiZH7SRM88/epHjYd/GX HpqDI1JWFTUV50VpY2stcH13Pjd9fF0FMQETa7bD8cThJ9eOya5Ru3dq6dnEyFtMBoD0BY eP0d+Dy5rKl+omP0BKQAoHgbUvCusemAFBWtCOTajqihk3udASNSiy/cdGgcEefLrOcwnW RDz1qvbB7laVNngpV2oznQJytrQpPpbndLnZdWXT2STfeDibKB9o/mRWzsgcCr4LKw7IcS 8/CajC4qxz/AHYk5Q0adoriKERwgJ6tBol3orzFMusYduUmTVRqOY++IQNBJHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707724923; 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=YXz/LWHiouEfSP8rxIkvmIj01fPJzb2gnfzz2mF0oSk=; b=vbhUnnif2wQYfBJw2ZHBI6skXNmDaq8fY14IYe41/d1GcDpY0QZF7GeQVeAtIyKAqeiR0z tDeLfC7NYLyOUM/Lful8F1hGaIOcnt6O0g7YQLrIIxJFY9dQZqhdRSRatbojnEWkIpf/b+ bIZD8Na9iuzrC60fTLRSf3RgCeOEELc0rLYNrWUevMlkTWoRkNHrgM2DFT3lGoFQjm5NUF rFcKkPBu0UNlH45NjVBsJi4Lk3gF/qb4vlolPiYYiPXfmOaA8bcBma2h8k/5ozdNjPY4kB zgV9xtFpRCtWWNJjtCJYRSTScYSkYDeuRUsqxJhMpF/gXiYzg3XcY3G07+uXGw== 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 4TYH3v4GCxzJS6; Mon, 12 Feb 2024 08:02:03 +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 41C823Rp037551; Mon, 12 Feb 2024 08:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41C823ji037548; Mon, 12 Feb 2024 08:02:03 GMT (envelope-from git) Date: Mon, 12 Feb 2024 08:02:03 GMT Message-Id: <202402120802.41C823ji037548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 81092e92ea51 - main - graid: unbreak Promise RAID1 with 4+ providers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 81092e92ea5184c4eeedad58044d72cfef72dd24 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=81092e92ea5184c4eeedad58044d72cfef72dd24 commit 81092e92ea5184c4eeedad58044d72cfef72dd24 Author: Eugene Grosbein AuthorDate: 2024-02-12 07:24:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-02-12 07:33:43 +0000 graid: 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 MFC after: 3 days --- 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 ba7a4d2b1cc4..d0d041e027c2 100644 --- a/sys/geom/raid/md_promise.c +++ b/sys/geom/raid/md_promise.c @@ -1762,8 +1762,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;