Page MenuHomeFreeBSD

ext2fs: Add large sectorsize disks support

Authored by fsu on May 10 2023, 5:16 PM.
Referenced Files
Unknown Object (File)
Tue, May 21, 10:20 PM
Unknown Object (File)
Mon, May 20, 3:35 PM
Unknown Object (File)
Fri, May 17, 9:34 PM
Unknown Object (File)
Fri, May 17, 7:21 PM
Unknown Object (File)
Sat, May 4, 1:35 PM
Unknown Object (File)
Mar 7 2024, 9:13 AM
Unknown Object (File)
Mar 7 2024, 8:33 AM
Unknown Object (File)
Mar 7 2024, 8:28 AM



Fix for issue:

The ext2fs does not support disks with sectorsize more 512 bytes. The main issue is in reading superblock, which is not aligned with 4k value.
Re-implement the superblock reading logic to make it indifferent to disk logical sector size. The logical sector size more then page size is not supported, like it is doing on Linux side.
Also, make some cleanups.

Test Plan

Tested using testcases with md devices with logical sector sizes:
512, 1024, 2048, 4096

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

fsu requested review of this revision.May 10 2023, 5:16 PM

Minimal changes, otherwise LGTM.

1382 ↗(On Diff #121814)

You could do the error thing within the if ( )

1384 ↗(On Diff #121814)

memset() instead of bcopy()

This revision is now accepted and ready to land.May 18 2023, 6:52 PM
This revision was automatically updated to reflect the committed changes.