gparted/include
Mike Fleetwood 3bea067596 Flush devices when scanning to prevent reading stale signatures (#723842)
While one partition is busy, reformat another partition from the command
line.  Afterwards parted/libparted still detects the original file
system and GParted shows errors from the file system specific tools
reporting the new file system doesn't exist.  Only limitation is that
the new new file system must be recognised by libparted (or by GParted's
fallback file system signature detection).

Case #1, File system reformatting:

    # parted /dev/sdb print
    Model: ATA SAMSUNG SSD UM41 (scsi)
    Disk /dev/sdb: 8012MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type     File system  Flags
     1      1049kB  2149MB  2147MB  primary  ext2
     2      2149MB  4296MB  2147MB  primary  ext2
    # mount | fgrep sdb
    /dev/sdb1 on /mnt/1 type ext2 (rw)

    # mkfs.xfs -f /dev/sdb2
    # blkid /dev/sdb2
    /dev/sdb2: UUID="c31823a2-b81b-46fa-8246-0a59695e4834" TYPE="xfs"
    # parted /dev/sdb print
    Model: ATA SAMSUNG SSD UM41 (scsi)
    Disk /dev/sdb: 8012MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type     File system  Flags
     1      1049kB  2149MB  2147MB  primary  ext2
     2      2149MB  4296MB  2147MB  primary  ext2
    # e2label /dev/sdb2
    e2label: Bad magic number in super-block while trying to open /dev/sdb2
    Couldn't find valid filesystem superblock.
    # dumpe2fs /dev/sdb2
    dumpe2fs 1.41.12 (17-May-2010)
    dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb2
    Couldn't find valid filesystem superblock.

Case #2, Removing device from multi-device btrfs:

    # btrfs filesystem show /dev/sdb1
    Label: none  uuid: a05db434-efd5-4e8c-902f-05f89a88b610
            Total devices 2 FS bytes used 156.00KB
            devid    2 size 2.00GB used 512.00MB path /dev/sdb2
            devid    1 size 2.00GB used 240.75MB path /dev/sdb1

    # mount /dev/sdb1 /mnt/1
    # btrfs device delete /dev/sdb2
    # btrfs filesystem show /dev/sdb1
    Label: none  uuid: a05db434-efd5-4e8c-902f-05f89a88b610
            Total devices 1 FS bytes used 92.00KB
            devid    1 size 2.00GB used 714.25MB path /dev/sdb1
    # btrfs filesystem show /dev/sdb2

and GParted reports this error for partition /dev/sdb2:
    Unable to read the contents of this file system!
    Because of this some operations may be unavailable.
    The cause might be a missing software package.
    The following list of software packages is required for btrfs
    file system support:  btrfs-tools.

This is another case of libparted reading from the whole disk device
(/dev/sdb) yet the file system tools use the partition specific block
device (/dev/sdb2), and the Linux buffer cache not providing cache
coherency.  Previous scenario was fixed with:

    797f0b8eeb
    Flush device after wiping a file system (#688882)

This affects libparted 2.0 to 3.1 inclusive and is fixed by:

    http://git.savannah.gnu.org/cgit/parted.git/commit/?id=fb99ba5ebd0dc34204fc9f1014131d5d494805bc
    Revert "linux-commit: do not unnecessarily open partition device nodes"

Fix by calling ped_device_sync() to guarantee cache coherency for each
device during scanning.

Bug #723842 - GParted resizes the wrong filesystem (does not pass the
              devid to btrfs filesystem resize)
2014-07-28 10:03:16 -06:00
..
.cvsignore added *.swp some modifications to pass 'make distcheck' minor cleanups 2005-11-25 12:59:47 +00:00
Copy_Blocks.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
DMRaid.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Device.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
DialogFeatures.h Make the File System Support dialog resizable (#342682) 2014-01-27 10:54:48 -07:00
DialogManageFlags.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Base_Partition.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Disklabel.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Partition_Copy.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Partition_Info.h Make the partition information dialog resizable (#690542) 2014-04-28 08:42:40 +01:00
Dialog_Partition_Label.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Partition_New.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Partition_Resize_Move.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Dialog_Progress.h Change OperationDetail to not store complex objects in STL containers (#729139) 2014-05-18 10:07:45 -06:00
Dialog_Rescue_Data.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
DrawingAreaVisualDisk.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
FS_Info.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
FileSystem.h Make partition busy detection method selectable per file system (#723842) 2014-07-28 10:03:16 -06:00
Frame_Resizer_Base.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Frame_Resizer_Extended.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
GParted_Core.h Flush devices when scanning to prevent reading stale signatures (#723842) 2014-07-28 10:03:16 -06:00
HBoxOperations.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
LVM2_PV_Info.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Makefile.am Restore compilation order of source files 2014-01-27 10:54:48 -07:00
Operation.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationChangeUUID.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationCheck.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationCopy.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationCreate.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationDelete.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationDetail.h Change OperationDetail to not store complex objects in STL containers (#729139) 2014-05-18 10:07:45 -06:00
OperationFormat.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationLabelPartition.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
OperationResizeMove.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Partition.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
PipeCapture.h Prevent cross thread write after free in _OnReadable() (#731752) 2014-07-06 10:22:40 -06:00
Proc_Partitions_Info.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
TreeView_Detail.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
Utils.h Make partition busy detection method selectable per file system (#723842) 2014-07-28 10:03:16 -06:00
Win_GParted.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
btrfs.h Display btrfs members in the Partition Information dialog (#723842) 2014-07-28 10:03:16 -06:00
exfat.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
ext2.h Use e2image to move/copy ext[234] file systems (#721516) 2014-03-05 22:12:10 +00:00
f2fs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
fat16.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
hfs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
hfsplus.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
i18n.h Make include guards unique (#539297) 2013-06-05 10:57:39 -06:00
jfs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
linux_swap.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
lvm2_pv.h Make partition busy detection method selectable per file system (#723842) 2014-07-28 10:03:16 -06:00
nilfs2.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
ntfs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
reiser4.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
reiserfs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
ufs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00
xfs.h Replace obsolete FSF postal address in copyright notices (#721565) 2014-01-26 10:53:23 +00:00