]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Revert "sfdisk: exit with error if rereading partition table fails"
authorKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2016 09:24:36 +0000 (11:24 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2016 09:24:36 +0000 (11:24 +0200)
This reverts commit 14f644f386a1708483ed446e983c0976e3976a9d.

It seems we have mess in reread-after-write:

all old versions to v2.20  -- returns 0
from v2.20 to v2.26        -- returns 1
since v2.26                -- returns 0

I think re-read errors should not be interpreted as fatal errors,
because it's pretty common that you want to modify only one partition
(e.g. resize) and then another partitions are probably still in use
and re-read all PT does not make sense.

What we need is to improve granularity for re-read and calls it only
when really necessary (all PT modified) and otherwise call BLKPG
(add/delete/resize) ioctls.

Reported-by: Nikhil Valluru <vvnikhil@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 0f329ed397cf0d9d0ef1093a58cf000f474214b6..d51b2613df6e47125fa363b61b46fdcaa76ba4e8 100644 (file)
@@ -535,7 +535,7 @@ static int write_changes(struct sfdisk *sf)
                        rc = move_partition_data(sf, sf->partno, sf->orig_pa);
                if (!rc) {
                        fdisk_info(sf->cxt, _("\nThe partition table has been altered."));
-                       rc = fdisk_reread_partition_table(sf->cxt);
+                       fdisk_reread_partition_table(sf->cxt);
                }
        }
        if (!rc)