From unknown Sat Jun 14 19:24:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#56996: gpt_partition_set_system possible regression Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Fri, 05 Aug 2022 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56996 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 56996@debbugs.gnu.org X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16596836787103 (code B ref -1); Fri, 05 Aug 2022 07:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Aug 2022 07:14:38 +0000 Received: from localhost ([127.0.0.1]:55976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJrXa-0001qV-7y for submit@debbugs.gnu.org; Fri, 05 Aug 2022 03:14:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:44838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJrXW-0001qK-68 for submit@debbugs.gnu.org; Fri, 05 Aug 2022 03:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJrXS-0004Fb-FG for bug-parted@gnu.org; Fri, 05 Aug 2022 03:14:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJrXS-00035v-2M for bug-parted@gnu.org; Fri, 05 Aug 2022 03:14:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=Tv8ZQn0wcury1k0GEz58t20fxDHUmyUAR9qFqaW/NrQ=; b=HrtjN9gcDeq74t IERBZQgn4vvh0yz5h1pvGmNu5G6hg7VlaMnt3ri11Tle9zfscr8BqkYCZpTug4oLPn/Wh4oqMA+FG a8chBT+Gu35IUSfUgTvVbDh9bc2J82YcpsEbP7py2vfUUl813k4Evkf/IUAe54k35jqvZKRkgCg/M ipRuh8zMuuufZKB4vYq5WP2eDDoI983j3KtjkjBvwA9GieNUYo2tS5xu6RGkYSu0D56D0w5unPw4s ZHL4i/Fr4WrnJkwzpik7GF3BWbGw2Ld1XVRBqZ/Gy5q5iN6FgDUvZTosw57AFyJ5wNfYDe1dlkRXr ydZb9rzbxntDXR74y3JA==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775]:50560 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJrXR-0000oe-3h for bug-parted@gnu.org; Fri, 05 Aug 2022 03:14:29 -0400 From: Mathieu Othacehe Date: Fri, 05 Aug 2022 09:14:26 +0200 Message-ID: <87wnbnyxf1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: -3.3 (---) Hello, In GNU Guix we are using GNU Parted via Guile-Parted bindings. Upgrading from Parted 3.4 to Parted 3.5 we discovered a possible regression. We are creation a new partition on a gpt disk this way: ped_partition_new (ext4) ped_partition_set_flag (PED_PARTITION_BIOS_GRUB) ped_partition_set_system (ext4) Since 15c49ec04f7eaff014d2e1eddd0aecf4150db63d, ped_partition_set_system forces the gpt_part_data->type to PARTITION_LINUX_DATA_GUID, whereas it used to conserve the gpt_part_data->type to PARTITION_BIOS_GRUB_GUID. This forces us to reverse the ped_partition_set_system and ped_partition_set_flag call order. Is that expected? Thanks, Mathieu From unknown Sat Jun 14 19:24:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#56996: gpt_partition_set_system possible regression Resent-From: "Brian C. Lane" Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Fri, 05 Aug 2022 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56996 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: Mathieu Othacehe Cc: parted-devel@lists.alioth.debian.org, 56996@debbugs.gnu.org Received: via spool by 56996-submit@debbugs.gnu.org id=B56996.165972267222437 (code B ref 56996); Fri, 05 Aug 2022 18:05:02 +0000 Received: (at 56996) by debbugs.gnu.org; 5 Aug 2022 18:04:32 +0000 Received: from localhost ([127.0.0.1]:60486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oK1gW-0005pp-74 for submit@debbugs.gnu.org; Fri, 05 Aug 2022 14:04:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oK1gT-0005pg-ME for 56996@debbugs.gnu.org; Fri, 05 Aug 2022 14:04:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659722669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dCTHONUDkCzzGpSlPiDym3Ik6ZuWor200B+11N4+HHI=; b=aXneeCKDElcymbDAyT4fE2oLGyl35yB94ixQX+yFbt3703k1iHW80pMh7oAutmso73AD+t NsqB61ROh8rpufJ3eBFMTegUIrzk6q6iN58UTRBn8g5G5H3F+35LYBuP6EyML5C0tuj1CH 76PW43bZFSUc4uQNSz/ymvbYhC2eG0Q= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-IjuXkbc3MlaDQoye-qnkfw-1; Fri, 05 Aug 2022 14:04:28 -0400 X-MC-Unique: IjuXkbc3MlaDQoye-qnkfw-1 Received: by mail-pj1-f69.google.com with SMTP id 1-20020a17090a190100b001f05565f004so1388567pjg.0 for <56996@debbugs.gnu.org>; Fri, 05 Aug 2022 11:04:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=dCTHONUDkCzzGpSlPiDym3Ik6ZuWor200B+11N4+HHI=; b=PuA31CXneDVpNTb8JG7SdrQGfHNHKT+Tge12KJFK308l03IA/gd7nwP0UoEMm/zycY sczISRCRYNDS3sOGuAcBnb257PA0BKsHaOkiPiB/wFzgTjHqhjmirUAPPUKsVKsTOsEa BOuZ4o1pwE5qAwq/pbbmom9UKcnWe6iZwtgT1xdNmyW9lt756rK64GoNk00fpfC009eW DYW/m2ecPTaQf7ZyikKsoSPqbiJn3rUbsyw+qsEgl5TsYELJhFKS5WjSzrQJQLiH2/h7 xlYIX/So2hCHfedAw/kbodnp8aGByNlINn6NkI539Rrc9AdHqRjs2zFqFV6mX42E+xJr tzng== X-Gm-Message-State: ACgBeo0Q08bQwMfc1IwmGhUMum/TfDFO+nfCAiLL86DtzmUBtgjPpB17 Y7P7KJqNn4ZpB04ObqzCoFTf38jDUgdh4S+p2/JQqkrV7QJrRHiYil3otPFMU0s8UR2YI1yR4WK He/xha4MCMS06n7E= X-Received: by 2002:a17:90b:1c01:b0:1f3:2f26:e7b2 with SMTP id oc1-20020a17090b1c0100b001f32f26e7b2mr8970900pjb.111.1659722667227; Fri, 05 Aug 2022 11:04:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MPjA12Y3YpTn8xtHqTjSXnXkxoDuHYOqBorALdwpP0Rt2XoX/sal9HvkDl0s2p9NlCUVLrQ== X-Received: by 2002:a17:90b:1c01:b0:1f3:2f26:e7b2 with SMTP id oc1-20020a17090b1c0100b001f32f26e7b2mr8970864pjb.111.1659722666769; Fri, 05 Aug 2022 11:04:26 -0700 (PDT) Received: from ohop.brianlane.com ([2601:603:5000:15f8:52e5:49ff:fe52:c5be]) by smtp.gmail.com with ESMTPSA id h12-20020a17090ac38c00b001f4fb21c11asm3355225pjt.21.2022.08.05.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 11:04:25 -0700 (PDT) Date: Fri, 5 Aug 2022 11:04:24 -0700 From: "Brian C. Lane" Message-ID: References: <87wnbnyxf1.fsf@gnu.org> MIME-Version: 1.0 In-Reply-To: <87wnbnyxf1.fsf@gnu.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: -0.7 (/) 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: -1.7 (-) On Fri, Aug 05, 2022 at 09:14:26AM +0200, Mathieu Othacehe wrote: > > Hello, > > In GNU Guix we are using GNU Parted via Guile-Parted bindings. Upgrading > from Parted 3.4 to Parted 3.5 we discovered a possible regression. > > We are creation a new partition on a gpt disk this way: > > ped_partition_new (ext4) > ped_partition_set_flag (PED_PARTITION_BIOS_GRUB) > ped_partition_set_system (ext4) > > Since 15c49ec04f7eaff014d2e1eddd0aecf4150db63d, ped_partition_set_system > forces the gpt_part_data->type to PARTITION_LINUX_DATA_GUID, whereas it > used to conserve the gpt_part_data->type to PARTITION_BIOS_GRUB_GUID. > > This forces us to reverse the ped_partition_set_system and > ped_partition_set_flag call order. Is that expected? I'm trying to recall why I approved that change. You're right, calling set_system does set the GUID back to the default for the filesystem. You shouldn't even need to call set_system in this case, you already set it with the call to _new(ext4), and set_flag will leave it set as long as you are turning a flag on. When you turn a flag off it has to figure out what to fall back to, so in that case it will call set_system to return to the default for the filesystem or LINUX_DATA if there is no filesystem set. I *think* I was considering the previous behavior a bug, we have a test that had been disabled for years (t3200 which tests the same thing on msdos) and these changes made it work again. I'm not entirely sure what to do about this. It's obviously a change in behavior, but it's a result of a big improvement in the code that I'd rather not revert. I should have bumped the library version to indicate this. I'm cc'ing this to the parted-devel list to get more input on how to go forward. Brian -- Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart From unknown Sat Jun 14 19:24:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#56996: gpt_partition_set_system possible regression Resent-From: "Brian C. Lane" Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Wed, 10 Aug 2022 16:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56996 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 56996@debbugs.gnu.org X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16601487361940 (code B ref -1); Wed, 10 Aug 2022 16:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Aug 2022 16:25:36 +0000 Received: from localhost ([127.0.0.1]:50598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLoWV-0000VD-KY for submit@debbugs.gnu.org; Wed, 10 Aug 2022 12:25:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:49590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLoWP-0000V0-Rn for submit@debbugs.gnu.org; Wed, 10 Aug 2022 12:25:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLoWP-00079k-LE for bug-parted@gnu.org; Wed, 10 Aug 2022 12:25:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLoWL-0002tr-Rq for bug-parted@gnu.org; Wed, 10 Aug 2022 12:25:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660148723; 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=91FPmRtERzuQRQlbaEBQv6/aH76Mt6z5AOfG2YQARyk=; b=JBnGDp4YnbjCCCjtgtFlmRboSZxCAWTORW6w0p/vg6vv6U8LI42dyXnhvh8GpOIIpkGlvF 2BfjxDM0Z27xvBs9wQth5aT7AxaRZutvD21xDdgIY0JWIIWvefSIHFg5fEDWDJSwZpZ1aR /BumZoCTNTJy3DUWuDe998lowpSpids= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-SPxIlxcYMPq7-QTiQpn_JQ-1; Wed, 10 Aug 2022 12:25:22 -0400 X-MC-Unique: SPxIlxcYMPq7-QTiQpn_JQ-1 Received: by mail-pj1-f70.google.com with SMTP id i2-20020a17090a650200b001f4f79056a6so1398449pjj.9 for ; Wed, 10 Aug 2022 09:25:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc; bh=91FPmRtERzuQRQlbaEBQv6/aH76Mt6z5AOfG2YQARyk=; b=AW8kTTjrUaaoidTWD0+popoiFh0agQ+6n2OfHY4c/mC5y3qiUX1AcuW4fu7LG+GT4M 3th8MXVAWZwFXhcRHmw5GloFclpQso8hI4NGiCWBkNrPHpwrPKUJMnb2r8oa47uL1kcR fT9baZtgHNxFrixIwXIxR4tPSKkZiDkrYS3aVEIWXEJq77TMG3zv0dlkNHSP3Qla999A r4hkESGb4gI0obrDxsBfHeQMUmqPlRMvxKdNjpHCxmgQcNXYpI+pKnc8Tgtej3wCAlsq VYdCIw/PvuhKee1DYBUMJVzwIwPNcKmDTAi0TnIds44o1fXJXFWjGsw29gKtN9DAvbYJ oe5A== X-Gm-Message-State: ACgBeo2DOJV7ReG90iBA5FLsW6t6pOdYVDPzlvY0Cz32ee48HKs1yPKY emiGiFQkha0izkoxl9INcGNzCR8yaWXr2WVzSuc2qFXj9D07WJlHyCJFN6YoZdZv6Htw1QOrz6Y PoUGXQn+cKkDUD9kj3EaNL5BhsMuEGLQ8Yn+mlsCZfQSE07ynq1sBLLND X-Received: by 2002:a63:2c8b:0:b0:41c:5f9e:a1d6 with SMTP id s133-20020a632c8b000000b0041c5f9ea1d6mr23192976pgs.601.1660148721146; Wed, 10 Aug 2022 09:25:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UnFg14X8rB45WC4sVJ3vYT7W822Tm59WHq59Gei/8PIQY0yJfzCaOlVo6fdltL+H0ZkkWrw== X-Received: by 2002:a63:2c8b:0:b0:41c:5f9e:a1d6 with SMTP id s133-20020a632c8b000000b0041c5f9ea1d6mr23192957pgs.601.1660148720710; Wed, 10 Aug 2022 09:25:20 -0700 (PDT) Received: from ohop.brianlane.com ([2601:603:5000:15f8:52e5:49ff:fe52:c5be]) by smtp.gmail.com with ESMTPSA id x13-20020a1709027c0d00b0016c20d40ee7sm13035522pll.174.2022.08.10.09.25.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 09:25:19 -0700 (PDT) Date: Wed, 10 Aug 2022 09:25:18 -0700 From: "Brian C. Lane" Message-ID: References: <87wnbnyxf1.fsf@gnu.org> MIME-Version: 1.0 In-Reply-To: <87wnbnyxf1.fsf@gnu.org> 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) On Fri, Aug 05, 2022 at 09:14:26AM +0200, Mathieu Othacehe wrote: > > Hello, > > In GNU Guix we are using GNU Parted via Guile-Parted bindings. Upgrading > from Parted 3.4 to Parted 3.5 we discovered a possible regression. > > We are creation a new partition on a gpt disk this way: > > ped_partition_new (ext4) > ped_partition_set_flag (PED_PARTITION_BIOS_GRUB) > ped_partition_set_system (ext4) > > Since 15c49ec04f7eaff014d2e1eddd0aecf4150db63d, ped_partition_set_system > forces the gpt_part_data->type to PARTITION_LINUX_DATA_GUID, whereas it > used to conserve the gpt_part_data->type to PARTITION_BIOS_GRUB_GUID. > > This forces us to reverse the ped_partition_set_system and > ped_partition_set_flag call order. Is that expected? I've proposed this set of patches to fix this, if possible could you test them out with your application? https://alioth-lists.debian.net/pipermail/parted-devel/2022-August/005819.html Thanks, Brian -- Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart