OpenBSD Journal

p2k16 Hackathon Report: krw@ on pdisk, softraid and more

Contributed by tj on from the chasing-squirrels dept.

The next hackathon report comes from Ken Westerback, who writes:

I arrived at CDG, got on my train and arrived in Nantes just before a national train strike started. Whew. Did a pleasant walk paralleling the tram tracks to the appropriate tram stop and consulted the documentation. "Hackroom is nearby." Hmmm. Wandered around for a while without stumbling across it, and finally noticed the large neon sign for the hotel. From which I *did* have directions. Got to the hackroom building and found that the doors had been locked early. A few frantic texts later I got in and the normal hackathon routine took hold.

Most of my hacking was a series of small projects to empty out my inbox.

I pestered Theo into ok'ing a tweak to pdisk(8) command line handling vs pledge(2). I plugged a small memory leak in installboot(8). I made dhclient(8) exit when the interface returned EAFNOSUPPORT in response to a broadcast attempt. I added a mention of the softraid(4) metadata version change to the FAQ. I corrected a softraid error message text. I made softraid panic on receiving a SCSI command without the associated discipline necessary to issue said command. I shuffled some efiboot code around to make its findopenbsd[_gpt]() more like others. I fixed the softraid hot spare processing to ensure that only hotspares with useful sector sizes are used in rebuilds. I was on a roll! The inbox was getting less and less intimidating!

Then I hit the ext2fs email.

After pelikan@ added support for reading ext4 filesystems for 5.6, rumblings began about fsck_ext2fs(8) not working. Somebody named Lampshade finally sent a detailed description of his troubles which I saved for later consideration.

The first issue was fsck_ext2fs issuing an error message -- "VALUES IN SUPERBLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE" -- even for a newly created filesystem. Which you'd think would be consistant. This turned out to be the struct ext2fs needing some padding out to the expected size of 1024 bytes. Less garbage in, fewer error messages out.

The second issue was fsck_ext2fs finding badly formed inodes even on a newly created filesystem. After chasing several squirrels into places too tight to follow, inducing Bob to run Linux on a VM on his Jesus computer, and lining Landry up to possibly reboot his laptop I remembered e2fsprogs in ports. And since it was a ports hackathon I decided to try them out!

This quickly resulted in identifying fsck_ext2 as the culprit, not newfs creating bad filesystems. And subsequently proving that the ext2 inode changes pelikan@ had made, adding several fields, had not been accompanied by changes to fsck_ext2fs to handle different sized inodes. Looking at the source (NetBSD) of his changes I found EXT2_DINODE_SIZE() and related tweaks, which when applied let fsck_ext2fs work again. Yay! Wait, the hackathon is over?!

Thanks to gilles@ and friends for an excellent hackathon. And special kudos on his joint effort with Theo to beat back the high school girls badminton team that almost stole our hotel rooms!

And thanks to you for the report, Ken!

(Comments are closed)

  1. By Anonymous Coward ( on

    Thanks for the writeup and the fix of the ext2fs fsck, I did come across that too on an older snapshot openbsd when I had problems with my RPI, so it did ring bells, just shows that the OpenBSD team is always a few steps ahead and I should have been staying -current.


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]