gparted/include
Mike Fleetwood b9d3638a12 Fix false usage figures for busy SWRAID members (#27)
Create an active Linux Software RAID member which is larger than /dev
virtual file system and GParted will report the usage figure of the /dev
virtual file system for the SWRAID member.

    # df -h /dev
    Filesystem      Size  Used Avail Use% Mounted on
    devtmpfs        732M     0  732M   0% /dev
    # sgdisk -n 1:1M:+1G /dev/sdb
    # mdadm --create --verbose /dev/md1 --level=linear --raid-devices=1 --force /dev/sdb1
    mdadm: Defaulting to version 1.2 metadata
    mdadm: array /dev/md1 started.

GParted reports the usage of /dev/sdb1 as:
    Partition  Mount Point  Size     Used   Unused     Unallocated
    /dev/sdb1  /dev/md1     1.00GiB  0.00B  731.04MiB  292.96MiB

However GParted should have reported the usage as "---" for unknown
because it isn't coded to query the size of the SWRAID member within a
partition.

The fault has been bisected to this commit:
    Extend un/mounting and usage reporting to unsupported file systems (!13)
    95903efb1f

What happens for busy Linux Software RAID array members:
*   GParted_Core::is_busy()
    has custom code to identify busy members.
*   GParted_Core::set_mountpoints()
    has custom code to add the array device name as the "mount point" of
    the member.
*   GParted_Core::set_used_sectors()
    falls into the else not a supported file system (because SWRAID
    doesn't have a derived FileSystem implementation class).
*   GParted_Core::mounted_set_used_sectors()
    is called to get the file system usage of mounted, but unsupported
    file systems, such as UFS and any others.
*   Utils::get_mounted_filesystem_usage()
    is called which queries the kernel using statvfs() and gets the file
    system usage of the /dev virtual file system because the array
    device name will always start /dev.

Fix by ensuring that GParted only asks the kernel for the usage of paths
which it knows are mount points of mounted file systems.  (As read from
/proc/mounts and cached in the Mount_Info module).  Also rename the
method, by inserting "_fs", to mounted_fs_set_used_sectors() to remind
us that it is for mounted *file systems* only.

Closes #27 - GParted may report incorrect usage for SWRAID partitions
             instead of unknown

S
2018-11-19 16:43:29 +00:00
..
BlockSpecial.h Pre-populate BlockSpecial cache while reading /proc/partitions (#767842) 2016-08-06 09:47:58 -06:00
CopyBlocks.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DMRaid.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Device.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DialogFeatures.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
DialogManageFlags.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DialogPasswordEntry.h Clear previous LUKS unlock failure error before next attempt (#795617) 2018-06-19 10:54:48 -06:00
Dialog_Base_Partition.h modern-gtk2: Use OptionComboBox class for alignment combobox (!17) 2018-11-12 21:50:42 +00:00
Dialog_Disklabel.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Dialog_FileSystem_Label.h Simplify from Gtk::Table to HBox in FileSystem Label dialog 2018-06-18 10:15:33 -06:00
Dialog_Partition_Copy.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
Dialog_Partition_Info.h modern-gtk2: Use Cairo for drawing the partition info (!17) 2018-11-12 21:50:42 +00:00
Dialog_Partition_Name.h Simplify from Gtk::Table to HBox in Partition Name dialog 2018-06-18 10:15:33 -06:00
Dialog_Partition_New.h modern-gtk2: Rename callback after OptionComboBox class switch (!17) 2018-11-12 21:50:42 +00:00
Dialog_Partition_Resize_Move.h Move struct FS and FS_Limits into FileSystem.h 2018-01-28 10:09:35 -07:00
Dialog_Progress.h Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING 2017-11-26 10:53:52 -07:00
Dialog_Rescue_Data.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
DrawingAreaVisualDisk.h modern-gtk2: Use Cairo for drawing the partition visualizer (!17) 2018-11-12 21:50:42 +00:00
FS_Info.h Make sure that FS_Info cache is loaded for all named paths (#787181) 2017-09-12 19:10:20 +01:00
FileSystem.h Separate unknown file system type from unsupported actions (!13) 2018-09-17 15:36:09 +00:00
Frame_Resizer_Base.h modern-gtk2: Use Cairo for drawing the partition resizer (!17) 2018-11-12 21:50:42 +00:00
Frame_Resizer_Extended.h modern-gtk2: Use Cairo for drawing the partition resizer (!17) 2018-11-12 21:50:42 +00:00
GParted_Core.h Fix false usage figures for busy SWRAID members (#27) 2018-11-19 16:43:29 +00:00
HBoxOperations.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
LUKS_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
LVM2_PV_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Makefile.am modern-gtk2: Introduce OptionComboBox class (!17) 2018-11-12 21:50:42 +00:00
Mount_Info.h Add and set read-only mount flag in the Partition object (#10) 2018-09-20 16:30:15 +00:00
Operation.h Create and use general find_extended_partition() function 2017-01-14 08:49:58 -07:00
OperationChangeUUID.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCheck.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCopy.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationCreate.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationDelete.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationDetail.h Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING 2017-11-26 10:53:52 -07:00
OperationFormat.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationLabelFileSystem.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationNamePartition.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OperationResizeMove.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
OptionComboBox.h modern-gtk2: Delay construction of Gtk::TreeModel* objects (!17) 2018-11-12 21:50:42 +00:00
Partition.h Add and set read-only mount flag in the Partition object (#10) 2018-09-20 16:30:15 +00:00
PartitionLUKS.h Rename enum FILESYSTEM to FSType 2018-01-28 10:09:35 -07:00
PartitionVector.h Create and use general find_extended_partition() function 2017-01-14 08:49:58 -07:00
PasswordRAMStore.h Change to insert or replace PasswordRAMStore::store() interface (#795617) 2018-04-30 09:10:48 -06:00
PipeCapture.h Further improve speed of PipeCapture for non-watched output (#777973) 2017-06-02 11:47:35 -06:00
Proc_Partitions_Info.h Switch to a static interface for Proc_Partitions_Info 2016-08-06 09:47:58 -06:00
ProgressBar.h Write a generic progress bar class (#760709) 2016-02-12 09:09:56 -07:00
SWRaid_Info.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
TreeView_Detail.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
Utils.h Recognise APFS (Apple File System) (#23) 2018-11-12 20:39:55 +00:00
Win_GParted.h modern-gtk2: Use Gtk::Widget::set_tooltip_text() (!17) 2018-11-12 21:50:42 +00:00
btrfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
exfat.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
ext2.h Remove checks for e4fsprogs commands (#794253) 2018-03-26 10:16:45 -06:00
f2fs.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
fat16.h Rework scope of fat16:: and ntfs::Change_UUID_Warning vectors 2018-06-18 14:47:17 -06:00
hfs.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
hfsplus.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
i18n.h Make include guards unique (#539297) 2013-06-05 10:57:39 -06:00
jfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
linux_swap.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
luks.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
lvm2_pv.h Make get_custom_text() and get_generic_text() return by reference 2018-06-18 10:15:33 -06:00
minix.h Add support for minix file system (!12) 2018-08-24 20:22:08 +01:00
nilfs2.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
ntfs.h Rework scope of fat16:: and ntfs::Change_UUID_Warning vectors 2018-06-18 14:47:17 -06:00
reiser4.h Remove "../include/" from GParted header #includes 2016-12-12 13:15:34 -07:00
reiserfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00
udf.h Set dynamic UDF file system size limits (#787204) 2018-01-28 10:09:35 -07:00
xfs.h Stop providing a default for FileSystem::resize() fill_partition argument 2016-12-12 13:15:34 -07:00