Skip to content

There is a problem with btrfs partition unmount #962

@HeroesLoveToRoujiamo

Description

@HeroesLoveToRoujiamo

The U disk is formatted into multiple btrfs file system partitions. When the U disk is directly pulled out, only one btrfs file system partition can be unmounted.

The reason for this problem is:
When the U disk is pulled out, udisks_state_check_mounted_fs_entry() will unmount the first btrfs partition first. Then mounts_changed_event() is triggered. Causes the udisks_state_check_mounted_fs_entry function to be called and UDisksMountMonitor *monitor to be updated. The remaining btrfs partitions will enter the udisks_mount_monitor_parse_mountinfo() function when unmounted, namely:

if (major == 0)
        {
……

              if (stat (mount_source, &statbuf) != 0)
                {
                  udisks_warning ("Error statting %s: %m", mount_source);
                  continue;
                }

              if (!S_ISBLK (statbuf.st_mode))
                {
                  udisks_warning ("%s is not a block device", mount_source);
                  continue;
                }

              dev = statbuf.st_rdev;
            }

Since the U disk has been pulled out, "stat (mount_source, &statbuf)" cannot obtain the device file information, so an exception occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions