From nobody Sat Feb 17 18:36:02 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 4Tccv70SyGz5BlNw; Sat, 17 Feb 2024 18:36:03 +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 4Tccv66kR3z46NJ; Sat, 17 Feb 2024 18:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708194962; 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=9DTvrihq2VFdY9//BxJbir+GKDlSKguDofbMZNqL+jk=; b=tRry6W6PFif76dBgCI3aubYvbxThA055cU44SDyvTJ1ua0KBXT8riHwp532L6ZxGamC7o+ uOOqrs1ZFMQobkKw8pANtYy4GrMuZessfOgrxuQ9jTsqueXi4L5cQZ/b6VD7KfmtuDOAed mwsq4gOR2keks8S2GwQM5s9rBAye5Wou4MidUHPONl7gDxeMK59eLHm2oZjMCWob83JXki oH76yzeNBHmr7KUZrsEjh6XqdH8edmIqoz7vKOPLrXzQKO26UkBH4RZOq/ye6W2221Rc6f 5pTte3AinkUMfjuKGMWeVSCIiCyc9Kc6rTtY6Gm/zH6piegWhQDYM5YIXnZcHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708194962; 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=9DTvrihq2VFdY9//BxJbir+GKDlSKguDofbMZNqL+jk=; b=A47RES7itorHKv2WwgJ0V44SJmF7OX0EWtK2w8KD7ck8b5WNkp/x2ONTg3UfhmVsy08n/1 XotYxr+oYPdXOWjPcEAdGg6wZXzXELyUIvFAEwruI2MReMQUT1HtVieF8JX/H/nCQc0Mjf x8Za192B36fc81rWkTsZZ//vmWlTXI5b91wY5WXnlfERqTFAsPppaRwQ3IznVsaSPG0bUe DKxjlCfCOzRojH/IHW8crg4aKwdIF8X0CwGr1q0kFCcS/1/tm2DrFk9hh3pP8rIUQU8Hcx WuCkBJKPQ0ju8jOxTHh90zoroQagQnaXFuNnFoY+71qbBrUyjVdZY+LOw5UFfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708194962; a=rsa-sha256; cv=none; b=vUB24jF+mZ0gC11NEDGk3TsAPx1O/16Tv1kdYuU4eTpyLbmRgHPW0cR6x1guEabqHCbfw2 TRhg/26Y5xHUNDU287/+MlzEgK06mgDHJLZeekxCjJoQRBe7SZMTWSOnQrCYAy68j7uKXY kp2sNmSUE8OVktEEXBV6g08F5xVLQzxMk6nQ8ApnbxlVn3owxvjBjJmiVIekkWPqYvVsR7 1OvzQuE3YtPZ03sEMnwaNaStykoW3aVSPz23hmbZ0N/0xVC50G9bfaBgnq/MxRwHa/R570 WR0Vc8qaolEhq39nzle8Kczy6FW7ssHxy6aimj57GoYmZZA4QqRN8UjSw83ZJQ== 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 4Tccv65mvxzJGJ; Sat, 17 Feb 2024 18:36:02 +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 41HIa2KI016675; Sat, 17 Feb 2024 18:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41HIa2Et016672; Sat, 17 Feb 2024 18:36:02 GMT (envelope-from git) Date: Sat, 17 Feb 2024 18:36:02 GMT Message-Id: <202402171836.41HIa2Et016672@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: 394ceefc2f2f - releng/13.3 - 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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 394ceefc2f2f586f303461428497d3961b89d078 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=394ceefc2f2f586f303461428497d3961b89d078 commit 394ceefc2f2f586f303461428497d3961b89d078 Author: Eugene Grosbein AuthorDate: 2024-02-12 07:24:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-02-17 18:35:20 +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 Approved-by: re (cperciva) (cherry picked from commit 81092e92ea5184c4eeedad58044d72cfef72dd24) (cherry picked from commit 77814c95994aab102be0e327de788dc1c00c023d) --- 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;