From unknown Tue Jun 17 22:28:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66740: fail to run 'parted -s /dev/loop0 mklabel MSDOS' Resent-From: li wang Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Wed, 25 Oct 2023 07:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66740 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 66740@debbugs.gnu.org Cc: li wang X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16982186974771 (code B ref -1); Wed, 25 Oct 2023 07:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Oct 2023 07:24:57 +0000 Received: from localhost ([127.0.0.1]:57189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvYG6-0001Eq-Bk for submit@debbugs.gnu.org; Wed, 25 Oct 2023 03:24:56 -0400 Received: from lists.gnu.org ([2001:470:142::17]:40168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvUGD-0000Hu-Q2 for submit@debbugs.gnu.org; Tue, 24 Oct 2023 23:08:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvUFX-0001Nw-MX for bug-parted@gnu.org; Tue, 24 Oct 2023 23:08:05 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvUFV-0003Am-W9 for bug-parted@gnu.org; Tue, 24 Oct 2023 23:08:03 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b1d1099a84so4958475b3a.1 for ; Tue, 24 Oct 2023 20:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698203280; x=1698808080; darn=gnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=h7rkdrvw9j5zg579THLMDYMBYY7gbweqfxnn+/Gx95A=; b=AY6blZK2ApIqR8NgpwTFvIyjjvfwHaG1iq0RJc6Tn7YqCfncfFn/qFYEkHg8SeR9G8 6fzijYEZjFCPIb4TKVoLqpoEfSloZXziy+i7MOfmjcZvuZgtryT83IzHq4wPvVHA5PCJ OpXiuhJYRFS2JsTVHN7MjQNzwKq7mvOxX9JwgLlJ0b3Rgmf5jTZ4Q5XZ9h2t6jYwLdMa LprOsJmjhsq1q+5g/R7aVIo5TtjYSKzBSdNvCnhtkNpMiY6LbrwRYLfYDPKLtqhJS0re bCIyT/qc2FC3fexG2Zz1iTRMp234Jbzang0xHM6K/6R9UA/GcMSy9fUtOaSnjuQyXIVC 4Ing== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698203280; x=1698808080; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h7rkdrvw9j5zg579THLMDYMBYY7gbweqfxnn+/Gx95A=; b=Fz1Dvmczfzg69tR/TtboG+X7QpFnqt2WtHqIWmQs/c/Odea7TjL1dsn4Nhn9n6rn5E D6787k+KOxCoUYbDrA6vKcr8CwzUrJuz3qt6AAzDB2ZV4pLJQ32XBNzadKV72VW/tQ1/ Jd4Dc5ki6xvCIKfMMrYP5akXSZMQBVwnNWJitEYdBqCBX7UnLAeHFddFAoAihgAU9oRn DslIkRLx4gy/p/DSE/Dl4DuXE0HMP+5es6p4UfxIp8wGX3AEXQUYslR3vtA/1NfvWbI7 MPdT2YfjKj1iIePpmgKwjSXhby9F9eI+iySM1JiyDp3jHkcuqfEgBVBTNoNWs8gxdQjK eYQg== X-Gm-Message-State: AOJu0YwZu/M6OZ+8Ji0MgeEo5p4268SRC6YE4dy8l2UagpKx9n/JSeq3 pq6t+1gF9I/QrnwTADQxRTRHLQyjvoBQ7QvDZ4t/3PwyB7I= X-Google-Smtp-Source: AGHT+IH0lGMbkKUQ2BYSA8nHueHR09rfSuORGO5cwl/VwLtZDGd+b8s1TwiVX++5cd6SfT4f1QLGKu7uqqDXegiDYRg= X-Received: by 2002:a05:6a20:3d1e:b0:14c:f16a:2b78 with SMTP id y30-20020a056a203d1e00b0014cf16a2b78mr4991075pzi.45.1698203279651; Tue, 24 Oct 2023 20:07:59 -0700 (PDT) MIME-Version: 1.0 From: li wang Date: Wed, 25 Oct 2023 11:07:49 +0800 Message-ID: Content-Type: multipart/alternative; boundary="0000000000003d799d060881c3c5" Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=lwang8512@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: *test case:* # systemctl restart systemd-udevd # systemctl status systemd-udevd # dd if=/dev/zero of=./blk-file bs=1M count=200 Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lwang8512[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (lwang8512[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message X-Mailman-Approved-At: Wed, 25 Oct 2023 03:24:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --0000000000003d799d060881c3c5 Content-Type: text/plain; charset="UTF-8" *test case:* # systemctl restart systemd-udevd # systemctl status systemd-udevd # dd if=/dev/zero of=./blk-file bs=1M count=200 # losetup -f # losetup /dev/loop0 ./blk-file # losetup -f # parted -s /dev/loop0 mklabel MSDOS Error: Partition(s) 1, ..., 64 on /dev/loop0 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. # echo $? 1 *root case:* linux kernel update: Upstream commit 1a721de8489fa559ff4471f73c58bb74ac5580d3 + if (disk->flags & GENHD_FL_NO_PART) + return -EINVAL; parted: libparted/arch/linux.c 3075 static int _disk_sync_part_table (PedDisk* disk) 3077 { ... 3165 if (!ok[i - 1] && errnums[i - 1] == ENXIO) 3166 ok[i - 1] = 1; /* it already doesn't exist */ 3167 } *thought:* parted codes need refresh according to kernel of return value. --0000000000003d799d060881c3c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
test case:

# systemctl restart = systemd-udevd
# systemctl status systemd-udevd

# dd i= f=3D/dev/zero of=3D./blk-file bs=3D1M count=3D200

# lose= tup -f

# losetup /dev/loop0 ./blk-file

# parted -s /dev/loop0 mklabel MSDOS

<= p style=3D"margin:10px 0px 0px;padding:0px;color:rgb(23,43,77);font-family:= -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,= "Fira Sans","Droid Sans","Helvetica Neue",san= s-serif;font-size:14px">Error: Partition(s) 1, ..., 64 on /dev/loop0 have b= een written, but we have been unable to inform the kernel of the change, pr= obably because it/they are in use. As a result, the old partition(s) will r= emain in use. You should reboot now before making further changes.
# ech= o $?
1

root case:

linux kernel update:
Upstream commit 1a721de8489fa559ff4471f73c= 58bb74ac5580d3
+ =C2=A0 =C2=A0 =C2=A0 if (disk->flags & GENHD_FL_= NO_PART)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -EINV= AL;

parted: libparted/arch/linux.c
3075 = static int _disk_sync_part_table (PedDisk* disk)
3077 {
...
3165 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!ok[i - 1] &= ;& errnums[i - 1] =3D=3D ENXIO)
3166 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ok[i - 1] =3D 1; /* it= already doesn't exist */
3167 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=

thought:

parted= codes need refresh according to kernel=C2=A0of return value.

--0000000000003d799d060881c3c5-- From unknown Tue Jun 17 22:28:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66740: fail to run 'parted -s /dev/loop0 mklabel MSDOS' Resent-From: "Brian C. Lane" Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Wed, 25 Oct 2023 15:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66740 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 66740@debbugs.gnu.org X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169824787811225 (code B ref -1); Wed, 25 Oct 2023 15:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Oct 2023 15:31:18 +0000 Received: from localhost ([127.0.0.1]:59811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvfqo-0002uy-8x for submit@debbugs.gnu.org; Wed, 25 Oct 2023 11:31:18 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvfql-0002uc-BK for submit@debbugs.gnu.org; Wed, 25 Oct 2023 11:31:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvfq4-0005c8-O3 for bug-parted@gnu.org; Wed, 25 Oct 2023 11:30:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvfq2-0006k2-1p for bug-parted@gnu.org; Wed, 25 Oct 2023 11:30:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698247827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TWsrpWA+47nIuyBRJBYPC0zFkWWSYvuE7i+VgUjL2hQ=; b=VtS+FTBXpvzj7YzOA/GSKNsrhNhtpopcQ2CAl/I80mR2a5FBIpy7YZX17fe8znBkkxM2Q2 K3Rfo+8kWLiGOlY8K3NpDNR9jhuJ0RKTiuJx50bGl4VayK85xdhaWzCS+a6l3zkMgyr7oW XEkc5H8p3wfTE71s/ZhZvWNTRaxtP0k= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-43-5IcmifRgOZGXYQHCw5eK9A-1; Wed, 25 Oct 2023 11:29:21 -0400 X-MC-Unique: 5IcmifRgOZGXYQHCw5eK9A-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1c9d4a0ec8aso61538885ad.2 for ; Wed, 25 Oct 2023 08:29:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698247760; x=1698852560; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TWsrpWA+47nIuyBRJBYPC0zFkWWSYvuE7i+VgUjL2hQ=; b=iaS9+vF4UXOmOcB947h5n0sPqd32LD0CZQw3WgHr2GfMpPhcyPFR62iaFL01UHQ1sX Tt3D5YRiRlFV+/KAjfTvgW0cP2RDcpLnTkNMOrf3MCBx3HTI5x5U18Vf459+CPOH2huP 9D4dKexq/rVAzgFKTH/ENGMarL5QePkMzzPW/LjBduI6FKIYjzaEB3+Rzd2QPFsRimvh NofthLkZ/QROTnVHf5uoupNVp3NTEbXxJo7DUpQgTpfC9QuIUFvWfxRDClQlyb52sYPx Tdn7WXAuIqtwg+oICmDNLgHDoxnPEQeHoBHLsRKo2on/8FSruNXcOrDt81apcJZTP+Jj Z8GQ== X-Gm-Message-State: AOJu0YwBuYoXJjKk+6Q9jR5Pz/z6lbJqX85vq776cl7IrmEabOrZFlYn JjfZmRdlBMGljsFWq9IKs4L+Mv0UMEukxZKejth+Gx9LfWoS/lTjPp/l3m2mKBF13z99CxRtmxy RqL0fzz1SRwwTAE5V/LGk1RJ6H1gDjHvp1VnWmxgrdr7L50CuB9KaopTSy4/TZzBZ X-Received: by 2002:a17:903:2342:b0:1ca:e7f9:a49b with SMTP id c2-20020a170903234200b001cae7f9a49bmr11549675plh.23.1698247760650; Wed, 25 Oct 2023 08:29:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbKU8B+al13aX/m2VfudavNnLyzqxGYn1ie4JyyuCfM+oHxQj1avGXJCjVV6c7UpyCMb3s6g== X-Received: by 2002:a17:903:2342:b0:1ca:e7f9:a49b with SMTP id c2-20020a170903234200b001cae7f9a49bmr11549648plh.23.1698247760242; Wed, 25 Oct 2023 08:29:20 -0700 (PDT) Received: from ohop.brianlane.com ([2601:603:5000:103:52e5:49ff:fe52:c5be]) by smtp.gmail.com with ESMTPSA id j4-20020a170902c3c400b001c619fbd5fbsm5528775plj.298.2023.10.25.08.29.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 08:29:18 -0700 (PDT) Date: Wed, 25 Oct 2023 08:29:17 -0700 From: "Brian C. Lane" Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=bcl@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, Oct 25, 2023 at 11:07:49AM +0800, li wang wrote: > *test case:* > > # systemctl restart systemd-udevd > # systemctl status systemd-udevd > > # dd if=/dev/zero of=./blk-file bs=1M count=200 > > [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [209.85.214.197 listed in dnsbl.sorbs.net] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On Wed, Oct 25, 2023 at 11:07:49AM +0800, li wang wrote: > *test case:* > > # systemctl restart systemd-udevd > # systemctl status systemd-udevd > > # dd if=/dev/zero of=./blk-file bs=1M count=200 > > # losetup -f > > # losetup /dev/loop0 ./blk-file > > # losetup -f > > # parted -s /dev/loop0 mklabel MSDOS > > Error: Partition(s) 1, ..., 64 on /dev/loop0 have been written, but we have > been unable to inform the kernel of the change, probably because it/they > are in use. As a result, the old partition(s) will remain in use. You > should reboot now before making further changes. > # echo $? > 1 > > *root case:* > > linux kernel update: > Upstream commit 1a721de8489fa559ff4471f73c58bb74ac5580d3 > + if (disk->flags & GENHD_FL_NO_PART) > + return -EINVAL; > > parted: libparted/arch/linux.c > 3075 static int _disk_sync_part_table (PedDisk* disk) > 3077 { > ... > 3165 if (!ok[i - 1] && errnums[i - 1] == ENXIO) > 3166 ok[i - 1] = 1; /* it already doesn't exist */ > 3167 } > > *thought:* > > parted codes need refresh according to kernel of return value. Thanks, I'll have to dig into this when I have time. As a workaround you don't need to attach the file to a loop device, parted can run on the file directly. Brian -- Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart