1. 19 Oct, 2016 1 commit
  2. 16 Oct, 2016 2 commits
  3. 14 Oct, 2016 1 commit
  4. 10 Oct, 2016 2 commits
  5. 06 Oct, 2016 1 commit
    • Mike Fleetwood's avatar
      Prevent the UI hanging while gpart data rescue is running (#772123) · aeebee9c
      Mike Fleetwood authored
      Running Device > Attempt Data Rescue... hangs the GParted UI for as long
      as gpart takes to scan the whole disk device looking for file system
      signatures.
      
      Originally when gpart support was added by commit [1] a separate thread
      was created to run gpart.  Then most threading was removed by commit [2]
      which left gpart running in the main thread blocking the UI.
      
      [1] ef37bdb7
          Added support to lost data recovery using gpart
      
      [2] 52a2a9b0
          Reduce threading (#685740)
      
      guess_partition_table() hand codes using Glib to run the gpart command
      asynchronously reading standard output, but it just doesn't run the Gtk
      main loop to process events, hence the UI hangs.  Instead just use
      Utils::execute_command() which handles everything already.  It runs the
      commands asynchronously, reading output and if being run in the main
      thread also calls the Gtk main loop to keep the UI responsive.
      
      Bug 772123 - GParted is unresponsive while gpart is running
      aeebee9c
  6. 05 Oct, 2016 7 commits
    • Mike Fleetwood's avatar
      Make GParted exit when closed before the initial load completes (#771816) · 7ea22f11
      Mike Fleetwood authored
      If the GParted main window is closed before the initial device load
      completed gpartedbin never exits.  The main window closes but the
      process sits there idle forever.  Subsequently running GParted reports
      this error:
          # gparted
          The process gpartedbin is already running.
          Only one gpartedbin process is permitted.
      
      If the user is running GParted from a desktop menu they will never see
      this error so they will never know why GParted won't start any more.
      
      More technically, it is if the main window is closed before the
      Win_GParted::on_show() callback completes.
      
      I assume the Gtk main loop doesn't setup the normal quit handling until
      the on_show() callback finishes drawing the main window for the first
      time.  Following this hint [1], move the initial device load from the
      on_show() callback to immediately after it completes by using a run once
      idle callback setup in on_show().
      
      This looks exactly the same to the user except now gpartedbin exits when
      the main window is closed during the initial device load.  Note that
      GParted finished the device load before exiting.  This is exactly the
      same as happens when exiting during subsequent device refreshes.
      
      [1] How to know when a Gtk Window is fully shown?
          http://stackoverflow.com/questions/14663212/how-to-know-when-a-gtk-window-is-fully-shown
      
          "If you want to know when your main window appears the first time,
          it is far easier (and saner) add a g_idle_add after your show_all
          call."
      
      Bug 771816 - GParted never exits if the main window is closed before the
                   initial device load completes
      7ea22f11
    • Mike Fleetwood's avatar
      Line wrap file system status value in the Information dialog (#771693) · 770ce9a9
      Mike Fleetwood authored
      Again this is to handle a long list of mount points for a single
      partition.  To prevent the file system status value of "Mounted on [list
      of 20 mount points]" causing the dialog to become wider than the screen,
      line wrap the text.  This instead makes the dialog taller, which already
      automatically scrolls vertically as needed.
      
      Bug 771693 - Mount Point column is wider than the screen on openSUSE
                   using btrfs root with lots of mounted subvolumes
      770ce9a9
    • Mike Fleetwood's avatar
      Show too wide Mount Point column with ellipsis (#771693) · 1f4f0a4b
      Mike Fleetwood authored
      openSUSE 42.1 with default btrfs root installation is heavily using
      subvolumes.  (Think of btrfs as a storage pool and subvolumes as
      individual file systems within the pool for a rough approximation).
      Thus the root partition is mounted on many mount points:
      
          # df -k
          Filesystem     1K-blocks    Used Available Use% Mounted on
          ...
          /dev/sda2       19445760 5820080  13157104  31% /
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/libvirt/images
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/mysql
          /dev/sda2       19445760 5820080  13157104  31% /.snapshots
          /dev/sda2       19445760 5820080  13157104  31% /home
          /dev/sda2       19445760 5820080  13157104  31% /var/opt
          /dev/sda2       19445760 5820080  13157104  31% /usr/local
          /dev/sda2       19445760 5820080  13157104  31% /var/tmp
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/named
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/mariadb
          /dev/sda2       19445760 5820080  13157104  31% /var/spool
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/pgsql
          /dev/sda2       19445760 5820080  13157104  31% /var/lib/mailman
          /dev/sda2       19445760 5820080  13157104  31% /srv
          /dev/sda2       19445760 5820080  13157104  31% /opt
          /dev/sda2       19445760 5820080  13157104  31% /var/crash
          /dev/sda2       19445760 5820080  13157104  31% /tmp
          /dev/sda2       19445760 5820080  13157104  31% /boot/grub2/i386-pc
          /dev/sda2       19445760 5820080  13157104  31% /var/log
          /dev/sda2       19445760 5820080  13157104  31% /boot/grub2/x86_64-efi
      
      As the Mount Point column contains all 20 mount points it makes the
      column wider than the screen, requiring lots of horizontal scrolling to
      see the following columns.  (Truncated to just 7 mounts in this
      example here).
      
          Partition     | File System | Mount Point
            /dev/sda1 * | # swap      |
            /dev/sda2 * | # btrfs     | /, /.snapshots, /boot/grub2/i386-pc, /boot/grub2/x86_64-efi, /home, /opt, /srv
      
      Fix by making the Mount Point column resizable and display truncated
      text with ellipsis.  The column now takes the initial and minimum width
      from the width of the "Mount Point" column header text.
      
          Partition     | File System | Mount Point     |   Size
            /dev/sda1 * | # swap      |                 |  1.45 GiB
            /dev/sda2 * | # btrfs     | /, /.snapsho... | 18.54 GiB
      
      Bug 771693 - Mount Point column is wider than the screen on openSUSE
                   using btrfs root with lots of mounted subvolumes
      1f4f0a4b
    • Mike Fleetwood's avatar
      Remove remaining vestiges of coloured text from the partition list · 85b68587
      Mike Fleetwood authored
      This commit stopped setting the text colours in the Partition, File
      System and Mount Point columns to avoid hard coding text colours making
      them impossible to read when using GNOME's High Contrast Inverse theme:
          ff2a6c00
          Changes post gparted-0.3.6 - code recreation from Source Forge
      
          * src/TreeView_Detail.cc: Removed text_color hard coding
            - Removed hard coding of Partition and Filesystem text_color
              which was based on if partition was TYPE_UNALLOCATED.
            - Removed hard coding of Mount text_color which was based
              on if partition was busy.  Lock symbol provides this indicator.
            - Closes GParted bug #413810 - Don't hardcode text colour in
              partition list
      
      Now remove the remaining vestiges left behind.  Remove the unused color
      text and mount_text_color columns from the tree model.  Also remove
      setting of the column attributes which set the colour of the text in the
      tree view from those unused columns in the tree model.
      
      Unnecessary history.  Added by:
          b179990d
          show greyed-out mountpoint of unmounted partitions in the treeview
          as an improved way to identify partitions
          Bug #333027 -  Displaying unmounted partitions' default mount points
          in grey
      
      and by commit only in CVS history:
          Bart Hakvoort <...> 2004-08-22 15:06:45
          Made text in Partition column darkgrey for unallocated. this offers
          more visual difference between partitions and unallocated space
      85b68587
    • Mike Fleetwood's avatar
      Include extended partitions in the count of active partitions · c6d29aa7
      Mike Fleetwood authored
      Trying to create a new partition table on a device with active
      partitions reports the number of active partitions in the error dialog.
      However when there is a busy logical partition the number of reported
      busy partitions will be one less than the number of partitions in the
      main UI showing the busy symbol.
      
      GParted considers extended partitions as busy when any of the logical
      partitions it contains as busy.  Display in the main UI reflects this.
      
      Fix Win_GParted::active_partitions_on_device_count() to not exclude
      extended partitions from the count.
      c6d29aa7
    • Mike Fleetwood's avatar
      Fix BlockSpecial comparison (#771670) · 253c4d64
      Mike Fleetwood authored
      Found that in some cases usage of active encrypted swap was not working,
      but only for the first encrypted swap partition.  This only failed on
      the first Device Mapper device, dm-0:
      
          # ls -l /dev/mapper/ /dev/dm-*
          brw-rw---- 1 root disk 254, 0 Oct  4 20:58 /dev/dm-0
          brw-rw---- 1 root disk 254, 1 Oct  4 20:58 /dev/dm-1
      
          /dev/mapper/:
          total 0
          crw------- 1 root root 10,236 Oct  4 19:48 control
          lrwxrwxrwx 1 root root      7 Oct  4 20:58 sdb1_crypt -> ../dm-0
          lrwxrwxrwx 1 root root      7 Oct  4 20:58 sdb2_crypt -> ../dm-1
      
          # cat /proc/swaps
          Filename                        Type        Size    Used    Priority
          /dev/sda1                       partition   1524732 92356   -1
          /dev/dm-0                       partition   1046524 0       -2
          /dev/dm-1                       partition   1046524 0       -3
      
      Was failing because the minor number of dm-0 was 0, causing BlockSpecial
      operator==() to fall back to name comparison rather than major, minor
      number, and GParted name /dev/mapper/sdb1_crypt doesn't match /dev/dm-0.
      
      Found on openSUSE and Ubuntu which don't use LVM by default and don't
      already have dm-0 used as an LVM Logical Volume which GParted doesn't
      support.
      
      The LINUX ALLOCATED DEVICES document [1] says block special device 0, 0
      (major, minor) is not used "reserved as null device number".   (Not to
      be confused with 1, 3 /dev/null the Null device).  All other
      non-negative pairs are valid block special device numbers.  Therefore
      update BlockSpecial operator==() accordingly; compare by major, minor
      number when either is greater than 0 falling back to string compare
      otherwise.  This still fits in with the BlockSpecial() constructor using
      major, minor numbers 0, 0 to represent plain files.
      
      [1] LINUX ALLOCATED DEVICES
          https://www.kernel.org/doc/Documentation/devices.txt
      
      Bug 771670 - Usage of active encrypted swap is not shown
      253c4d64
    • Mike Fleetwood's avatar
      Implement usage reporting of active encrypted swap partitions (#771670) · 3966cc3e
      Mike Fleetwood authored
      GParted does not show the usage of active encrypted swap partitions,
      instead showing partition warning "Unable to read the contents of this
      file system! ...".  OS setup:
      
          # ls -l /dev/mapper/sdb4_crypt /dev/dm-3
          brw-rw----. 1 root disk 253, 3 Sep 14 07:26 /dev/dm-3
          lrwxrwxrwx. 1 root root      7 Sep 14 07:26 /dev/mapper/sdb4_crypt -> ../dm-3
          # mkswap -L encrypted_swap /dev/mapper/sdb4_crypt
          # swapon /dev/mapper/sdb4_crypt
          # cat /proc/swaps
          Filename                        Type        Size    Used    Priority
          /dev/sda2                       partition   2097148 237632  -1
          /dev/dm-3                       partition   1046524 0       -2
      
      This is because the code was performing a string compare between the
      canonical /dev/mapper/sdb4_crypt name GParted is using and the /dev/dm-3
      name reported by the kernel via /proc/swaps.  Fix by creating
      BlockSpecial objects from the names and compare those so that comparison
      is done correctly using major, minor numbers.
      
      Bug 771670 - Usage of active encrypted swap is not shown
      3966cc3e
  7. 04 Oct, 2016 1 commit
  8. 03 Oct, 2016 1 commit
  9. 30 Sep, 2016 1 commit
  10. 22 Sep, 2016 1 commit
  11. 20 Sep, 2016 3 commits
  12. 14 Sep, 2016 3 commits
    • Mike Fleetwood's avatar
      Remove left behind typedef GParted_Core::MountMapping · d64283fd
      Mike Fleetwood authored
      Left behind by:
          63ec73df
          Split mount_info and fstab_info maps into separate Mount_Info module
      d64283fd
    • Mike Fleetwood's avatar
      Remove out of date comment from the end of set_devices_thread() · ab4040c5
      Mike Fleetwood authored
      The comment became completely unnecessary with the transfer of
      mount_info and fstab_info into separate Mount_Info module by commit:
          63ec73df
          Split mount_info and fstab_info maps into separate Mount_Info module
      
      It was never necessary to clear one of the mappings at the end of the
      device refresh because it was reloaded at the start of the next device
      refresh anyway and it is only a small amount of memory.
      ab4040c5
    • Mike Fleetwood's avatar
      Stop showing duplicate mount points for unmounted encrypted file systems (#771323) · 8c870cf7
      Mike Fleetwood authored
      Have an unmounted file system within an open encrypted mapping and an
      entry in /etc/fstab for the file system like this:
      
          # lsblk
          NAME           MAJ:MIN RM   SIZE RO TYPE   MOUNTPOINT
          ...
          sdb              8:16   0     8G  0 disk
          +-sdb1           8:17   0     1G  0 part
            +-sdb1_crypt 253:0    0  1022M  0 crypt
          # blkid | grep sdb1
          /dev/sdb1: TYPE="crypto_LUKS" ...
          /dev/mapper/sdb1_crypt: TYPE="ext4" ...
          # ls -l /dev/mapper/sdb1_crypt /dev/dm-0
          brw-rw----. 1 root disk 253, 0 Sep 12 19:09 /dev/dm-0
          lrwxrwxrwx. 1 root root      7 Sep 12 19:09 /dev/mapper/sdb1_crypt -> ../dm-0
          # grep sdb1 /etc/fstab
          /dev/mapper/sdb1_crypt   /mnt/1   ext4   defaults    0 0
      
      The mount point will be shown twice for the partition:
          /mnt/1, /mnt/1
      
      This is because add_node_and_mountpoint() adds two entries for both the
      symbolic and real block special names:
          map["/dev/mapper/sdb1_crypt"] = ["/mnt/1"]
          map["/dev/dm-0"]              = ["/mnt/1"]
      This was needed for the old code which used string compare to match
      block devices so that the mount point could be looked up by either name.
      However since bug 767842 introduced major, minor number comparison it
      became unnecessary.  As both names refer to the same device the mount
      point gets added twice to the same entry.  Hence display of the double
      mount.
          map[BlockSpecial{"/dev/mapper/sdb1_crypt", 253, 0}] =
                                                          ["/mnt/1", "/mnt/1"]
      
      It is always going to be the case that the symbolic link and real block
      special names have the same major, minor numbers.  That was the
      requirement of the BlockSpecial class and the reason for using stat() to
      lookup the numbers.  Therefore adding entries for both names will always
      add duplicate entries.  Fix by stop using realpath() to lookup the real
      name and adding the duplicate entry.
      
      Introduced by:
          a800ca8b
          Add BlockSpecial into mount_info and fstab_info (#767842)
      
      Bug 771323 - GParted is showing duplicate mount points for unmounted
                   encrypted file systems
      8c870cf7
  13. 13 Sep, 2016 1 commit
  14. 09 Sep, 2016 1 commit
  15. 04 Sep, 2016 2 commits
  16. 21 Aug, 2016 1 commit
  17. 20 Aug, 2016 1 commit
  18. 15 Aug, 2016 1 commit
  19. 06 Aug, 2016 9 commits
    • Mike Fleetwood's avatar
      Remove no longer needed includes from GParted_Core.cc · e6f4b1c3
      Mike Fleetwood authored
      No longer needed since commit:
          504eb04d
          Roll back (remove) code to recognize /dev/mapper/* devices, because ...
      e6f4b1c3
    • Mike Fleetwood's avatar
      Split mount_info and fstab_info maps into separate Mount_Info module · 63ec73df
      Mike Fleetwood authored
      The GParted_Core::mount_info and GParted_Core::fstab_info maps and the
      methods that manipulate them are self-contained.  Therefore move them to
      a separate Mount_Info module and reduce the size of the monster
      GParted_Core slightly.
      63ec73df
    • Mike Fleetwood's avatar
    • Mike Fleetwood's avatar
      Switch to static class interface for FS_Info · a94be2da
      Mike Fleetwood authored
      The FS_Info module has a pseudo multi-object interface and used the
      constructor to load the cache.  However all the data in the class is
      static.  An FS_Info object doesn't contain any member variables, yet was
      needed just to call the member functions.
      
      Make all the member functions static removing the need to use any
      FS_Info objects and provide an explicit load_cache() method.
      a94be2da
    • Mike Fleetwood's avatar
      Simplify whole device matching in load_proc_partitions_Info_cache() · 5055c0b6
      Mike Fleetwood authored
      Following earlier commit "Pre-populate BlockSpecial cache while reading
      /proc/partitions (#767842)" load_proc_partitions_info_cache() has
      extracted just the name field from each line of /proc/partitions.
      Therefore simplify the regular expressions matching each type of whole
      disk device to just matching in the name field rather than matching in
      the whole line.
      5055c0b6
    • Mike Fleetwood's avatar
      Switch to a static interface for Proc_Partitions_Info · 912766c2
      Mike Fleetwood authored
      The Proc_Partitions_Info has a pseudo multi-object interface and uses
      the constructor to load the cache.  However all the data in the class is
      static.  A Proc_Partitions_Info object doesn't contain any member
      variables, yet was needed just to call the member functions.
      
      Make all the member functions static removing the need to use any
      Proc_Partitions_Info objects and provide and explicit load_cache()
      method.
      912766c2
    • Mike Fleetwood's avatar
      Remove remaining use of retired vol_id · 91e5a096
      Mike Fleetwood authored
      Vol_id has been retired and removed from all supported distributions.
      See earlier commit "Remove use of retired vol_id from FS_Info module
      (#767842)" for more details.  Therefore remove it's use from GParted
      entirely.
      91e5a096
    • Mike Fleetwood's avatar
      Pre-populate BlockSpecial cache while reading /proc/partitions (#767842) · 571304d2
      Mike Fleetwood authored
      GParted is already reading /proc/partitions to get whole disk device
      names.  The file also contains the major, minor device number of every
      partition.  Use this information to pre-populate the cache in the
      BlockSpecial class.
      
          # cat /proc/partitions
          major minor  #blocks  name
      
             8        0   20971520 sda
             8        1     512000 sda1
             8        2   20458496 sda2
          ...
             9        3    1047552 md3
           259        2     262144 md3p1
           259        3     262144 md3p2
          ...
           253        0   18317312 dm-0
           253        1    2097152 dm-1
           253        2    8383872 dm-2
           253        3    1048576 dm-3
      
      Note that for Device-Mapper names (dm-*) the kernel is not using the
      canonical user space names (mapper/*).  There is no harm in
      pre-populating the cache with these names and will help if tools report
      them too.  It is just that for DMRaid, LVM and LUKS, GParted uses the
      canonical /dev/mapper/* names so will still have to call stat() once for
      each such name.
      
      For plain disks (sd*) and Linux Software RAID arrays (md*) the kernel
      name is the common user space name too, therefore matches what GParted
      uses and pre-populating does avoid calling stat() at all for these
      names.
      
      Bug 767842 - File system usage missing when tools report alternate block
                   device names
      571304d2
    • Mike Fleetwood's avatar
      Cache looked up major, minor numbers in BlockSpecial class (#767842) · 003d6eff
      Mike Fleetwood authored
      Creation of every BlockSpecial object used to result in a stat() OS
      call.  On one of my test VMs debugging with 4 disks and a few partitions
      on each, GParted refresh generated 541 calls to stat() in the
      BlockSpecial(name) constructor.  However there were only 45 unique
      names.  So on average each name was stat()ed approximately 12 times.
      
      Cache the major, minor number associated with each name after starting
      with a cleared cache for each GParted refresh.  This reduces these
      direct calls to stat() to just the 45 unique names.
      
      Bug 767842 - File system usage missing when tools report alternate block
                   device names
      003d6eff