From nobody Fri Feb 25 14:49:58 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 7A81B19EC67D for ; Fri, 25 Feb 2022 14:49:58 +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 4K4t3V1FJjz4R3w for ; Fri, 25 Feb 2022 14:49:58 +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 06B14216C9 for ; Fri, 25 Feb 2022 14:49:58 +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 21PEnv15052581 for ; Fri, 25 Feb 2022 14:49:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21PEnvS8052580 for bugs@FreeBSD.org; Fri, 25 Feb 2022 14:49:57 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 262189] ZFS volume not showing up in /dev/zvol when 1 CPU Date: Fri, 25 Feb 2022 14:49:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: afedorov@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: cc Message-ID: In-Reply-To: References: 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=1645800598; 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: in-reply-to:in-reply-to:references:references; bh=PaV3LrFEs7/soi0zDW0lGYvcwrzKwO44AuiTVdSeIuI=; b=ilWhMkF3vaIXBFyLN88Pl1qKF9eza8KsEIsVpOVeW3T1r5/Gso7TaiDAn0tsVGGw0DG7Qf NswXvyV6LU0WHOYrmXC6i9MNbcBXN7Abi/Eg8KvAWi6NRdO973/wB9AvXy6czdh4qlFGmx Z3Jef0Y7u567vOmlDjBo2S0RTGWroNZjGQAeWNv54DNCJz/9y0TC9P4SaSDCPZMb3kiTQW pqEwNIqRYNxZJpUfUcz4/LPQTYx68EHmMwnVJENd3bgmOBqbYXaRo61+1wddbp/Brm7KY3 8Rr5jBpXDVlD2pMyy6/bxkG9drkxlwc2tZvkOWHFbqR/pQ4Cr4UQ5abedZi+jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645800598; a=rsa-sha256; cv=none; b=HCIoPld9XWsM9rVduKcdYtBn0dOJStd935kpWch6ho7Nk23WrtD8d0GlDlJcEB2Mz/IO2o kmzn9ebzbg8RO7EpV8eg9U/i+hbmOpfJ9oQcntz3IgZSw2gC7C966hOTMC06RyLpRDmf/Z zdZGhulGpNH69XzLIrCoZ2xPSSy8Va3wnj4N8pzKh3rt1V5WkrgscaRYKl11Xmsukb/tks hidCbQmXfiF5/CvEhH4oKpkiavAi/vZirHqgfupFdAfKbSIjsIEK4iLXcFETfpBVpCR/Lz /W1VV+ZcHzT5UJ3q9MfJYvMuQXMjRgnZxqqybNeZTDCRbC1n2TrFp96CLMfxkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262189 Aleksandr Fedorov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |afedorov@FreeBSD.org --- Comment #2 from Aleksandr Fedorov --- There are two things. First, I think /dev/zvol//device is created asynchronously. Therefore, after the completion of the "zfs create ..." command, the device may not ha= ve been created yet and the dd command will fail. I think that if you add "sleep 5" to the script, the error will not be reproduced: seq 1 100 | while read i; do zfs create -o volmode=3Ddev -V 1G $name_pool/data$i sleep 5 dd if=3D/dev/zero of=3D/dev/zvol/$name_pool/data$i bs=3D1M done Second, the OpenZFS code creates a ZVOL device in a very strange way: https://github.com/openzfs/zfs/blob/master/module/zfs/zvol.c#L1394 /* * It's unfortunate we need to remove minors before we create new ones: * this is necessary because our backing gendisk (zvol_state->zv_disk) * could be different when we set, for instance, volmode from "geom" * to "dev" (or vice versa). */ First, a ZVOL device is created with the default volmode, then it's removed= and created with the requested one. In FreeBSD, the default value for vfs.zfs.vol.mode is 1 (GEOM). Therefore, there is a race between the ZFS and GEOM threads. That's why you see this error: "g_dev_taste: g_dev_taste(zvol/test/data22) failed to g_attach, error=3D6". For example output of the "cat /var/run/devd.pipe" when I create ZVOL (zfs create -V 1G -o volmode=3Ddev datapool/test). !system=3DGEOM subsystem=3DDEV type=3DCREATE cdev=3Dzvol/datapool/test !system=3DDEVFS subsystem=3DCDEV type=3DDESTROY cdev=3Dzvol/datapool/test !system=3DGEOM subsystem=3DDEV type=3DDESTROY cdev=3Dzvol/datapool/test !system=3DDEVFS subsystem=3DCDEV type=3DCREATE cdev=3Dzvol/datapool/test --=20 You are receiving this mail because: You are the assignee for the bug.=