Commit Graph

3287 Commits

Author SHA1 Message Date
Christian Kirbach d0f59f8ecf Update German translation 2017-12-27 09:53:39 +00:00
Daniel Mustieles c7464f16c4 Updated Spanish translation 2017-12-20 18:12:46 +01:00
Mike Fleetwood ff0360eb4f Match up OperationDetail creation and status setting for internal copy (#790842)
This is not required, but it is more logical to have an OperationDetail
object created and it's final status set in the same function rather
than split between caller and callee.  So move creation of
"copy %1 using a block size of %2" OperationDetail objects into
GParted_Core::copy().

Also introduces a couple of variables to remove some recomputation:
benchmark_od & remaining_length.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-12-11 13:53:09 -07:00
Mike Fleetwood e5ccb3b8bc Set OperationDetail status last during internal copy benchmarking (#790842)
Performing a copy or move operation which uses GParted's internal copy
routine triggered the new GParted bug message.  Example operation
details:

  Copy /dev/sdb8 to /dev/sdb (start at 4.51 GiB)               (SUCESSS)
  * calibrate /dev/sdb8                                        (SUCCESS)
  * check file system on /dev/sdb8 for errors and (if possib...(SUCCESS)
  * create empty partition                                     (SUCCESS)
  * set partition type on /dev/sdb9                            (SUCCESS)
  * copy file system from /dev/sdb8 to /dev/sdb9               (SUCCESS)
      using internal algorithm
      copy 1.00 GiB
    * finding optimal block size
      * copy 16.00 MiB using a block size of 1.00 MiB          (SUCCESS)
          16.00 MiB of 16.00 MiB copied
          GParted Bug: Adding more information to the result...(WARNING)
          0.797269 seconds
      * copy 16.00 MiB using a block size of 2.00 MiB          (SUCCESS)
      * copy 16.00 MiB using a block size of 4.00 MiB          (SUCCESS)
      * copy 16.00 MiB using a block size of 8.00 MiB          (SUCCESS)
      * copy 16.00 MiB using a block size of 16.00 MiB         (SUCCESS)
        optimal block size is 1.00 MiB
    * copy 944.00 MiB using a block size of 1.00 MiB           (SUCCESS)

This is because when performing the initial benchmarking copies the time
taken by each copy is added to the operation detail results in the
calling GParted_Core::copy_blocks() after the final status was set in
CopyBlocks::copy() with set_success_and_capture_errors().  Fix by
setting the final status in the parent function after adding the time to
the benchmark copies.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-12-11 13:53:09 -07:00
Piotr Drąg ddd3f450ef Update Polish translation 2017-12-10 16:07:52 +01:00
gogo 79bc2b7fed Update Croatian translation 2017-12-08 18:52:12 +00:00
Kukuh Syafaat e895becea6 Update Indonesian translation 2017-12-05 14:32:07 +00:00
Mike Fleetwood c7ee9934f1 Make OperationDetail no_more_children bug message translatable (#790842)
To be consistent with all previous bug messages being translatable.

Also only mark the bug as a warning instead of an error because the bug
doesn't cause any disk drive operations to fail.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-12-04 13:32:21 -07:00
Piotr Drąg 675760d3af Update Polish translation 2017-12-03 18:34:39 +01:00
Mike Fleetwood 2f53876c0f Wait for the kernel and udev to settle partitions for a second time (#790418)
There is still another subtle issue.  When GParted_Core::commit() closes
the device, the kernel initiates a second set of events which removes
and re-adds the partitions again.  Need to wait for these to complete
to prevent any following step failing with missing partition device
nodes.

Bug 790418 - "Unable to inform the kernel of the change" message may
             lead to corrupted partition table
2017-11-29 12:58:48 -07:00
Mike Fleetwood f49f0bb2b8 Avoid libparted failing to inform the kernel about partition changes (#790418)
Operations involving modifications to a partition are sometimes failing
with a libparted error informing the kernel about modifications to
partitions.  For example I encountered these errors when just creating a
fourth partition on CentOS 7 in a VirtualBox VM.  Operation results:

    Create Primary Partition #1 (ext4, 4.73 GiB) on /dev/sdb   (ERROR)
    * create empty partition                                   (ERROR)
      * libparted messages                                     (ERROR)
        * Error informing the kernel about modification to partition
          /dev/sdb1 -- Device or resource busy.  This means Linux won't
          know about any changes you made to /dev/sdb1 until you reboot
          -- so you shouldn't mount it or use it in any way before
          rebooting.
        * Failed to add partition 1 (Resource temporarily unavailable)

Those two libparted messages were presented in "Libparted Error" dialogs
and [Cancel] was selected both times.

        Libparted Error
    (-) Error informing the kernel about modifications to partition
        /dev/sdb1 -- Device or resource busy.  This means Linux won't
        know about any changes you made to /dev/sdb1 until you reboot --
        so you shouldn't mount it or use it in any way before rebooting.
                                                   [ Cancel ] [ Ignore ]

        Libparted Error
    (-) Failed to add partition 1 (Resource temporarily unavailable)
                                                    [ Retry ] [ Cancel ]

This is the edited output showing GParted print debugging, stracing of
GParted and monitoring of udev events for this case.

    # ./gpartedbin /dev/sdb
    ======================
    libparted : 3.1
    ======================
    ...
     24.541604 +23.923435 create_partition()   start (new_partition, optdet, min_size=0)  new_partition.device_path="/dev/sdb"
     24.556101 +0.014497 create_partition()   type=PED_PARTITION_NORMAL
     24.556354 +0.000253 commit()             start (lp_disk)  lp_disk->dev->path="/dev/sdb"
    D: strace pid 18054.  Press [Return] to continue.
    ^Z
    [1]+  Stopped          ./gpartedbin /dev/sdb

    # udevadm monitor &
    [2] 18124
    monitor will print the received events for:
    UDEV - the event which udev sends out after rule processing
    KERNEL - the kernel uevent

    # strace -p 18054 -e open,ioctl,write,close &
    [3] 18129
    strace: Process 18054 attached

    # fg %1
    ./gpartedbin /dev/sdb
    128.175811 +103.619457 commit()             calling ped_disk_commit_to_dev(lp_disk) ...
    open("/dev/sdb", O_RDWR)                = 6
    ioctl(6, BLKFLSBUF)                     = 0
    write(6, "\372\270\0\20\216\320\274\0\260\270\0\0\216\330\216\300\373\276\0|\277\0\6\271\0\2\363\244\352!\6\0"..., 512) = 512
    ioctl(6, BLKFLSBUF)                     = 0
    close(6)
    128.181352 +0.005542 commit()             ped_disk_commit_to_dev(lp_disk) returned true
    128.181475 +0.000122 commit_to_os()       start (lp_disk, timeout=10)  lp_disk->dev->path="/dev/sdb"
    128.181527 +0.000052 commit_to_os()       calling ped_disk_commit_to_os(lp_disk) ...
    open("/dev/sdb", O_RDWR)                = 6
    ioctl(6, BLKFLSBUF)                     = 0
    open("/sys/block/sdb/ext_range", O_RDONLY) = 7
    close(7)                                = 0

    KERNEL[1158935.380543] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    KERNEL[1158935.380565] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    KERNEL[1158935.380578] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)

    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=1, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=2, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=3, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ...

    KERNEL[1158935.380977] change   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block)
    KERNEL[1158935.381296] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    KERNEL[1158935.381367] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    KERNEL[1158935.381432] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    KERNEL[1158935.382992] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)

    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=62, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=63, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=64, devname="", volname=""}}) = -1 ENXIO (No such device or address)
    ioctl(6, BLKPG, {BLKPG_ADD_PARTITION, flags=0, datalen=152, data={start=1048576, length=1073741824, pno=1, devname="/dev/sdb1", volname=""}}) = -1 EBUSY (Device or resource busy)
    write(2, "Error informing the kernel about"..., 251) = 251
    Error informing the kernel about modifications to partition
    /dev/sdb1 -- Device or resource busy.  This means Linux won't know
    about any changes you made to /dev/sdb1 until you reboot -- so you
    shouldn't mount it or use it in any way before rebooting.

    UDEV  [1158935.384641] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    UDEV  [1158935.390203] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    UDEV  [1158935.390243] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    UDEV  [1158935.462866] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)
    UDEV  [1158935.469207] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    UDEV  [1158935.471512] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    UDEV  [1158935.492173] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)

    write(2, "Failed to add partition 1 (Resou"..., 60) = 60
    Failed to add partition 1 (Resource temporarily unavailable)
    close(6)

    KERNEL[1158955.730960] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    KERNEL[1158955.731095] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    KERNEL[1158955.731314] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    KERNEL[1158955.731397] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)
    KERNEL[1158955.731817] change   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block)
    KERNEL[1158955.731981] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    KERNEL[1158955.732166] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    KERNEL[1158955.732232] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    KERNEL[1158955.733955] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)

    148.533154 +20.351627 commit_to_os()       ped_disk_commit_to_os(lp_disk) returned false

    UDEV  [1158955.738262] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)
    UDEV  [1158955.738460] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    UDEV  [1158955.738525] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)

    148.537648 +0.004494 execute_command()    udevadm settle --timeout=10

    UDEV  [1158955.740864] remove   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)
    UDEV  [1158955.760192] change   /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block)
    UDEV  [1158955.801211] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block)
    UDEV  [1158955.815262] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block)
    UDEV  [1158955.815314] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block)
    UDEV  [1158955.828134] add      /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block)

    148.630797 +0.093149 execute_command()              exit status 0
    148.630882 +0.000085 commit_to_os()                 return false
    D: stop strace pid 18054.  Press [Return] to continue.
    ^Z
    [1]+  Stopped          ./gpartedbin /dev/sdb

    # kill %3
    strace: Process 18054 detached
    [3]-  Done             strace -p 18054 -e open,ioctl,write,close

    # kill %2
    [2]   Done             udevadm monitor

    # fg %1
    ./gpartedbin /dev/sdb
    173.700143 +25.069261 commit()             return false
    173.700470 +0.000327 create_partition()   return false

What happens is that GParted calls ped_disk_commit_to_dev() which opens
the device, writes the updated partition table and closes the device.
When the device closes the kernel initiates asynchronous uevents and
user space udev rules which remove and re-add all the partitions.  In
the mean time GParted calls ped_disk_commit_to_os() to inform the kernel
of the changes to the partition table.  This involves opening the
device, using ioctl() to remove all possible partitions [1] and re-add
needed partitions.  It finds partitions 1 to 3 already removed and
accepts this along with all other non-existent partitions up to 64.
When it tries to re-add partition 1 the ioctl() BLKPG_ADD_PARTITION call
returns EBUSY.  Presumably because the partition is in use by udev which
is in the process of running the user space rules associated with
removing and re-adding it.  Then ped_disk_commit_to_os() closes the
device which initiates a second round of asynchronous uevents and user
space udev rules removing and re-adding all the partitions again.

So in summary the kernel and udev are removing and re-adding the
partitions exactly when libparted is trying to do exactly the same
thing!

[1] The algorithm in libparted 3.1 is to try to remove all possible
    partitions, 64 for this kernel, followed by re-adding the needed
    partitions.

    parted/libparted/arch/linux.c:_disk_sync_part_table()
    http://git.savannah.gnu.org/cgit/parted.git/tree/libparted/arch/linux.c?h=v3.1#n2541

Partprobe has had exactly the same issue with failing to inform the
kernel about modifications to the partition table [2].  This was fixed
in libparted post v3.2 release by this commit [3].

[2] rhbz#1339705 - ceph-disk prepare: Error: partprobe /dev/vdb failed :
    Error: Error informing the kernel about modifications to partition
    /dev/vdb1 -- Device or resource busy.

    https://bugzilla.redhat.com/show_bug.cgi?id=1339705

[3] partprobe: Open the device once for probing

    Previously there were 3 open/close pairs for the device, which may
    result in triggering extra udev actions. Instead, open it once at
    the start of process_dev and close it at the end.

    http://git.savannah.gnu.org/cgit/parted.git/commit/?id=cfafa4394998a11f871a0f8d172b13314f9062c2

Implement the same fix as implemented for partprobe.  Hold a file handle
open which libparted can use internally to avoid having to open() and
close() the device itself twice, once for each of the calls
ped_disk_commit_to_dev() and ped_disk_commit_to_os().  This avoids the
first close() initiating the kernel and udev to remove and re-add the
partitions exactly when ped_disk_commit_to_os() is trying to do the same
thing.

Bug 790418 - "Unable to inform the kernel of the change" message may
             lead to corrupted partition table
2017-11-29 11:37:26 -07:00
Mike Fleetwood f9ae35584b Remove left behind #include "ProgressBar.h"
The includes were missed being removed by this earlier refactoring
commit which reduced direct access to the single ProgressBar object:
    b1313281bd
    Simplify use of the progress bar via OperationDetail (#760709)
2017-11-26 10:53:52 -07:00
Mike Fleetwood 8c5c13d613 Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING
Make the enumeration name match it's use as indicating a warning.  Also
spell SUCCESS correctly.  Follow on to icon variable names too.
2017-11-26 10:53:52 -07:00
Mike Fleetwood 0688662055 Identify libparted messages as either success or error (#790842)
All libparted messages were reported as informational, even for a step
which failed.  Instead identify libparted messages as either
informational or errors depending on whether this step was successful
or not respectively.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:24 -07:00
Mike Fleetwood b4cd5da4f7 Set the status last for the OperationDetails in mk/rm_temp_dir() (#790842)
Resizing any unmounted file system which has to be mounted to be resized
triggered the new GParted bug message.  However the operation did
complete successfully.  Example operation details:

  Grow /dev/sdb8 from 1.00 GiB to 1.50 GiB                     (SUCCESS)
  * calibrate /dev/sdb
  * check file system on /dev/sdb8 for errors and (if possib...(SUCCESS)
  * grow partition from 1.00 GiB to 1.50 GiB                   (SUCCESS)
  * grow file system to fill the partition                     (SUCCESS)
    * mkdir -v /tmp/gparted-wvH0Ez                             (SUCCESS)
      * GParted Bug: Adding another child after no_more_chil...(ERROR)
      * Created directory /tmp/gparted-wvH0Ez
    * mount -v -t btrfs '/dev/sdb8' '/tmp/gparted-wvH0Ez'      (SUCCESS)
    * btrfs filesystem resize 1:max '/tmp/gparted-wvH0Ez'      (SUCCESS)
    * umount -v '/tmp/gparted-wvH0Ez'                          (SUCCESS)
    * rmdir -v /tmp/gparted-wvH0Ez                             (SUCCESS)
      * GParted Bug: Adding another child after no_more_chil...(ERROR)
      * Removed directory /tmp/gparted-wvH0Ez

This is because set_success_and_capture_errors() was called first and
the child details added after.  Reverse this ordering to fix.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:19 -07:00
Mike Fleetwood 2040aabd22 Transition other code to callback error collection (#790842)
Transition all remaining code, DMRaid and file system code, to use the
new method of reporting success of a step and automatic error
collection.  None of this code calls libparted so can't generate any
libparted exceptions.  This is just for consistency so all code follows
the same pattern using set_success_and_capture_errors().

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:18 -07:00
Mike Fleetwood bf1e87ecf3 Refactor ntfs resize code (#790842)
Refactor nested if-then-else into a sequence of if fail return early.
Makes the code simpler to understand and converts separate
OperationDetail::set_status() calls for success or error into a single
call using ternary conditional matching how it is or was done everywhere
else.  This is also ready for status and error capture refactoring.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:18 -07:00
Mike Fleetwood 76088a39de Transition code using libparted to callback error collection (#790842)
Transition GParted block copying code and partition manipulation code,
which uses libparted API, to the new method of reporting success of a
step and automatic error collection.  Libparted exceptions are now
reported with the step at which they occurred.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:18 -07:00
Mike Fleetwood 0a78c39856 Allow child OperationDetails to emit error capture callback too (#790842)
Just copies the callback into each newly added child detail.  As there
are no more uses of set_success_and_capture_errors() yet, libparted
errors are still only captured once at the top-level of each operation.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:18 -07:00
Mike Fleetwood 23939331f6 Capture libparted messages via callback at top-level only (#790842)
Replace the explicit adding of libparted exception messages with a
callback to do it instead, and fire the callback just once per operation
by only changing the very top-level OperationDetail to use the new
set_success_and_capture_errors().  Therefore this still produces exactly
the same operation details with libparted messages at the end of each
operation.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:53:18 -07:00
Mike Fleetwood 2ed7feb2f5 Add mechanism to capture exception messages into an OperationDetail (#790842)
All code implementing a step of an operation follows this pattern:

    od.add_child(OperationDetail("Step heading"));
    od.get_last_child().add_child(OperationDetail("More details"));
    // Do step
    success = ...
    od.get_last_child().set_status(success ? STATUS_SUCCESS
                                           : STATUS_ERROR);

At this point any libparted messages reported via exceptions need to be
added into the OperationDetail tree.  Also adding further children into
the tree after collecting those errors needs to be prohibited (as much
as the previous patch prohibited it).

Add a new method which will replace the final set_status() call above
like this which set the status, captures the errors and flags that
further children shouldn't be added:

    ...
    od.get_last_child().set_success_and_capture_errors(status);

It emits a callback to capture the errors to provide flexibility and so
that the OperationDetail class doesn't have to get into the details of
how GParted_Core saves libparted exception messages.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:52:54 -07:00
Mike Fleetwood f8f9a72de6 Add mechanism to stop adding more child OperationDetails (#790842)
Want functionality to prevent further child details being added to an
OperationDetail.  This is so that the captured libparted error messages
are always the last child in the list, and more details (at that point
in the tree) can't be added.

For example we want GParted to report like this:

  Move /dev/sdb3 to the right and shrink it from 1.14 GiB to...(SUCCESS)
  ...
  * shrink partition from 1.14 GiB to 1.00 GiB                 (SUCCESS)
    * old start: 4464640
      old end: 6856703
      old size: 2392064 (1.14 GiB)
    * new start: 4464640
      new end: 6561791
      new size: 2097152 (1.00 GiB)
    * libparted messages                                       (INFO)
      * DEBUG: GParted generated synthetic libparted excepti...

and not like this:

  Move /dev/sdb3 to the right and shrink it from 1.14 GiB to...(SUCCESS)
  ...
  * shrink partition from 1.14 GiB to 1.00 GiB                 (SUCCESS)
    * old start: 4464640
      old end: 6856703
      old size: 2392064 (1.14 GiB)
    * libparted messages                                       (INFO)
      * DEBUG: GParted generated synthetic libparted excepti...
    * new start: 4464640
      new end: 6561791
      new size: 2097152 (1.00 GiB)

So actually preventing the addition of more child details would stop
users seeing information they should see.  So instead just report a bug
message into the operation details.  This doesn't stop anything, but the
bug message will be seen and allow us to fix GParted.

So far nothing is enforced.  This patch just adds the mechanism to
report a bug when a new child detail is added when prohibited.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:06:37 -07:00
Mike Fleetwood 3c1fdd14f4 Also stop OperationDetail execution timer when setting status to N/A (#790842)
PATCH SET SUMMARY:

Libparted exception messages are reported into the operation details at
the end of each separate operation.  For operations which involve
multiple steps of partition manipulation there is no way to identify
which exceptions occurred with which steps.

Example resize/move operation in which multiple libparted exceptions
were raised:

  Move /dev/sdb to the right and shrink it from 1.15 GiB to ...(ERROR)
  * calibrate /dev/sdb3                                        (SUCCESS)
  * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS)
    * e2fsck -f -y -v -C 0 '/dev/sdb3'                         (SUCCESS)
  * shrink file system                                         (SUCCESS)
    * resize2fs -p 'dev/sdb3' 1048576K                         (SUCCESS)
  * shrink partition from 1.14 GiB to 1.00 GiB                 (SUCCESS)
  * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS)
    * e2fsck -f -y -v -C 0 '/dev/sdb3'                         (SUCCESS)
  * grow partition from 1.00 GiB to 1.12 GiB                   (SUCCESS)
  * move file system to the right                              (SUCCESS)
    * e2image -ra -p -O 134217728 '/dev/sdb3'                  (SUCCESS)
  * shrink partition from 1.12 GiB to 1.00 GiB                 (ERROR)
  * libparted messages                                         (INFO)
    * DEBUG: GParted generated synthetic libparted exception...
    * Error informing the kernel about modifications to part...
    * Error informing the kernel about modifications to part...
    * DEBUG: GParted generated synthetic libparted exception...
    * DEBUG: GParted generated synthetic libparted exception...

But there is no way to know which of the libparted steps: 1 calibrate or
3 partition resize steps encountered which exceptions.

Fix this by reporting the libparted messages into the operation details
at the point at which they occur.  Then the above example would become:

  Move /dev/sdb to the right and shrink it from 1.15 GiB to ...(ERROR)
  * calibrate /dev/sdb3                                        (SUCCESS)
  * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS)
    * e2fsck -f -y -v -C 0 '/dev/sdb3'                         (SUCCESS)
  * shrink file system                                         (SUCCESS)
    * resize2fs -p 'dev/sdb3' 1048576K                         (SUCCESS)
  * shrink partition from 1.14 GiB to 1.00 GiB                 (SUCCESS)
    * libparted messages                                       (INFO)
      * DEBUG: GParted generated synthetic libparted excepti...
  * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS)
    * e2fsck -f -y -v -C 0 '/dev/sdb3'                         (SUCCESS)
  * grow partition from 1.00 GiB to 1.12 GiB                   (SUCCESS)
    * libparted messages                                       (INFO)
      * Error informing the kernel about modifications to pa...
      * Error informing the kernel about modifications to pa...
      * DEBUG: GParted generated synthetic libparted excepti...
  * move file system to the right                              (SUCCESS)
    * e2image -ra -p -O 134217728 '/dev/sdb3'                  (SUCCESS)
  * shrink partition from 1.12 GiB to 1.00 GiB                 (ERROR)
    * libparted messages                                       (ERROR)
      * DEBUG: GParted generated synthetic libparted excepti...

THIS PATCH:

Small change so that setting the status of an OperationDetail to N/A,
warning, also stops the execution timer if it was running.  Matching
what happens when the status is set to either success or error.

This is to avoid having to set status twice, first time just to stop the
timer, and second time to set it to the desired status when reporting a
warning.

Bug 790842 - Report libparted messages into operation details at the
             point at which they occur
2017-11-26 10:06:37 -07:00
Ask Hjorth Larsen 572037d3fe Updated Danish translation 2017-11-11 18:44:53 +01:00
Alan Mortensen 1925515108 Updated Danish translation 2017-11-04 13:49:50 +01:00
Khaled Hosny 8fc5acf513 Update Arabic translation 2017-11-01 10:52:35 +02:00
Aurimas Černius 0792d4fc2a Updated Lithuanian translation 2017-10-15 22:12:15 +03:00
Milo Casagrande a455c4bfcd Update Italian translation 2017-10-11 14:03:35 +00:00
Curtis Gedak fccd29df18 Remove extraneous blank line from NEWS file 2017-10-10 10:45:53 -06:00
Curtis Gedak 6045e5a147 Append -git to version for continuing development 2017-10-10 10:43:13 -06:00
Curtis Gedak 1db4c5ae83 ========== gparted-0.30.0 ========== 2017-10-10 10:20:25 -06:00
Claude Paroz 48428df328 Updated French translation 2017-10-08 18:25:47 +02:00
Rūdolfs Mazurs 01ed87cbef Update Latvian translation 2017-10-08 10:09:39 +03:00
Daniel Șerbănescu 26eaa2a919 Update Romanian translation 2017-10-07 18:19:26 +00:00
Daniel Șerbănescu 08322ec626 Update Romanian translation 2017-10-07 18:18:16 +00:00
Mario Blättermann 15507b53c5 Update German translation 2017-10-04 17:54:12 +00:00
Daniel Mustieles d527fd13e8 Update Spanish translation 2017-10-04 10:25:26 +00:00
Daniel Mustieles e7c9269ce0 Update Spanish translation 2017-10-04 07:31:16 +00:00
Trần Ngọc Quân 1546e87e06 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2017-10-04 07:10:42 +07:00
Rafael Fontenelle 46595f67e5 Update Brazilian Portuguese translation 2017-10-03 19:00:56 +00:00
Rafael Fontenelle 5c31099ad7 Update Brazilian Portuguese translation 2017-10-03 17:26:48 +00:00
Mike Fleetwood 33a535390e Extract common code into new method get_lp_partition() 2017-10-03 08:22:19 -06:00
Mike Fleetwood 12dcebcb47 Calibrate whole disk device partitions again (#788308)
Fix up following switch from whole_device flag to TYPE_UNPARTITIONED.

Also calibrate the type for whole disk device partitions.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood bcd03e5c41 Restore Information dialog display of whole disk devices (#788308)
So they display as previously; as all grey in the graphic and with only
the correct attributes shown.

Fix up following switch from whole_device flag to TYPE_UNPARTITIONED.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood c1807ca504 Disallow formatting of unrecognised whole disk devices again (#788308)
Fix up following switch from whole_device flag to TYPE_UNPARTITIONED.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood b1967e7211 Allow Partition > New on unallocated whole disk devices again (#788308)
Fix up following switch from whole_device flag to TYPE_UNPARTITIONED.

Again use FS_UNALLOCATED to determine if a partition represents
unallocated space and creation of a new partition should be allowed.
This is so that trying to create a new partition on a whole disk device
shows the "No partition table found on device /dev/DEV" warning again.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood fa5ed1fb90 Select unallocated whole disk devices again (#788308)
After the change from whole_device flag to TYPE_UNPARTITIONED,
unallocated whole disk devices are no longer automatically selected
because the partition type is no longer TYPE_UNALLOCATED.  Fix by
checking for file system type FS_UNALLOCATED when identifying the
largest unallocated space.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood d5a20697c8 Display unrecognised whole disk devices as all grey again (#788308)
Following the switch from whole_device flag to TYPE_UNPARTITIONED,
unallocated space can be found in two partition types:
    TYPE_UNALLOCATED
    TYPE_UNPARTITIONED  (only when filesystem == FS_UNALLOCATED)

As the file system in both cases is FS_UNALLOCATED check for that when
determining whether a partition is unallocated or not.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood ea269cc929 Switch from whole_device flag to TYPE_UNPARTITIONED (#788308)
Remove whole_device flag and replace with new partition type
TYPE_UNPARTITIONED.  Minimally adapt the remaining code to compile and
run.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood c10d80a295 Add TYPE_UNPARTITIONED partition type (#788308)
Just adds the enumeration.  Using it will follow.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00