Skip to content
Commit 3966cc3e authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak
Browse files

Implement usage reporting of active encrypted swap partitions (#771670)

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
parent 3d780457
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment