Page MenuHomeFreeBSD

ext2fs: Add large sectorsize disks support
ClosedPublic

Authored by fsu on May 10 2023, 5:16 PM.
Tags
None
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
Subscribers

Details

Summary

Fix for issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271105

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 https://github.com/thedrgreenthumb/Jenkins/tree/master/Target/ext2fs_test_all testcases with md devices with logical sector sizes:
512, 1024, 2048, 4096

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

Minimal changes, otherwise LGTM.

fs/ext2fs/ext2_vfsops.c
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.