Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udiskslinuxpartitiontable: Reprobe the device in case of missing udev attributes #1110

Merged
merged 2 commits into from
May 29, 2023

Conversation

tbzatek
Copy link
Member

@tbzatek tbzatek commented May 25, 2023

Happens frequently with protective MBR tables (vfat) that the ID_PART_TABLE_TYPE udev attribute is not set. In such cases partprobe often reports:

$ partprobe -s /dev/sdb
/dev/sdb: loop partitions 1

Thus use libblockdev libfdisk probe to see what's actually on the device.

… attributes

Happens frequently with protective MBR tables (vfat) that
the ID_PART_TABLE_TYPE udev attribute is not set. In such cases
partprobe often reports:

  $ partprobe -s /dev/sdb
  /dev/sdb: loop partitions 1

Thus use libblockdev libfdisk probe to see what's actually
on the device.
@tbzatek
Copy link
Member Author

tbzatek commented May 25, 2023

Should fix these test failures:

======================================================================
FAIL: test_protective_part_overwrite_mounted (test_80_filesystem.VFATTestCase.test_protective_part_overwrite_mounted)
Test overwriting the master block device carrying a protective partition table having the nested partition mounted.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/workspace/udisks-pr/arch/x86_64/distro/f_37/type/udisks/src/tests/dbus-tests/test_80_filesystem.py", line 935, in test_protective_part_overwrite_mounted
    pttype.assertNotEqual('gpt')
  File "/home/jenkins/workspace/udisks-pr/arch/x86_64/distro/f_37/type/udisks/src/tests/dbus-tests/udiskstestcase.py", line 204, in assertNotEqual
    raise AssertionError('%s == %s' % (self._value, value))
AssertionError: None == gpt

@tbzatek tbzatek marked this pull request as draft May 25, 2023 14:25
Although a protective partition table is properly created on the disk,
its detection by kernel is rather random. Haven't found a way to force
probing and its presence, issuing partprobe on the device usually hides
it at all. So just make the test to work with what's available and skip
if nothing has been detected.
@tbzatek tbzatek marked this pull request as ready for review May 26, 2023 14:21
Copy link
Member

@vojtechtrefny vojtechtrefny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It seems to be working and I guess it could be worse :-) Let's hope this is the last hack for vfat.

@tbzatek tbzatek merged commit eff9274 into storaged-project:master May 29, 2023
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants