From nobody Sat Aug 20 23:52:14 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 4M9Flz5gDNz4ZcWv for ; Sat, 20 Aug 2022 23:52:15 +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 4M9Flz0mHtz46C1 for ; Sat, 20 Aug 2022 23:52:15 +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 4M9Fly6xhxzqB1 for ; Sat, 20 Aug 2022 23:52:14 +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 27KNqEba037594 for ; Sat, 20 Aug 2022 23:52:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 27KNqEoi037593 for bugs@FreeBSD.org; Sat, 20 Aug 2022 23:52:14 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 237392] growfs : operation not permitted Date: Sat, 20 Aug 2022 23:52:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: tofig@freebsd.az 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=1661039535; 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=JGPh0R+DKLMyZ3tBSmbzD3cVQ7y3eyq0jQ3Kp+/rmAE=; b=mLmDoRldyGLZUTnQ4i2YOIgeOkzxv6bDlFXVti5nS/nlVv6Rjm4YaA23fuZZnDaPyrVhIP RRZ1VYPjVsJm47eh0ayzbu+AGn+kNXlTcLvXbNd3qQK+Yx7KIvK7UOOJfPYNZj0pQBdPCk qbZdGh7UJmY3s24XdykL+OflFv8Za/DO+TZ/31yzIZqwQSgf/tFLyGZYai/whi7VqLdvda HGbgvtVzlCARM1JBYTTVMZcY6Abf+NmrnegAlamhDSxIG2dK0oaBpg/uJyohZ00jZ2dLOW Ww96PpTN4S8zgaSmBHWtqdSPYCFiGJB2q5G7+CBRCbZ5BGLeOxweDeUlFoBZYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661039535; a=rsa-sha256; cv=none; b=ATm+LdGIJx7PT+DPETKRqo4D9pKNKTJLa5UvxO1RDOZz0WXkTUVBaCzBnjsbIrtMs9XMVH oWgUx0wIjMI5G3QKetuNaAAokcz5EUaQEXxx5FltU/2p4qML63tLIA4w7Re7k9kD9tFauL CO1ih0W0ndqIQinxUeh1y9trESDRUV0N+57uOXHXwvIVyl9sgjrUSSxHr3kx5PmHPzmpL8 ijfIhg93Dgu3A2B13IL8y7Upz/tfrUkslVDNZU49PNCBQHn0/HsW+UGt+kJIl3HQljacoQ ijyxpiJdxopoeHAHevBh5DgaZ9huXdKonOVQ43iVJGVQzSpxYDjnhBTvq8EEJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237392 tofig@freebsd.az changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tofig@freebsd.az --- Comment #2 from tofig@freebsd.az --- This issue is still present on RELEASE-13.1 with the following uname -a out= put: FreeBSD parent 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC arm64 I've done some bug triaging and hopefully it helps to fix it. Growfs calls dev_to_statfs() to find out the mountpoint on which the device= is currently mounted. This is the listing for dev_to_statfs: https://github.com/freebsd/freebsd-src/blob/main/sbin/growfs/growfs.c#L1437 Inside dev_to_statfs(), getmntinfo() returns the list of all active mounts along with the information for each of them. /dev/vtbd0p4 is likely not in = the list of mounted devices; instead /dev/gpt/rootfs is. Therefore dev_to_statf= s() is not able to find the mountpoint under which /dev/vtbd0p4 is mounted, and hence returns NULL. Later on, there is a check for the return value from dev_to_statfs(): https://github.com/freebsd/freebsd-src/blob/main/sbin/growfs/growfs.c#L1576 This check is to differentiate for 2 separate cases: 1) device is mounted a= nd 2) device is not mounted. In your case, though the device is mounted (but u= nder a different name) the second case is taken and we attempt to open the device directly: fso =3D open(device, O_WRONLY); This operation fails with the error that you were seeing in your test. If getmntinfo() was able to detect that your device /dev/vtbd0p4 was mounted under a different name (likely / ?), then the ufs-suspend mechanism would be used and that would possibly work just fine.=20 I am not quite sure how dev_to_statfs() is supposed to derive the informati= on about /dev/vtbd0p4 being mounted using a different device name like /dev/gpt/rootfs. --=20 You are receiving this mail because: You are the assignee for the bug.=