Old, old bug


I posted a little about this before, but here’s more prompted by several people mentioning it: a seekdir() bug found and fixed by Marc Balmer is apparently present in all BSDs, going back at least 25 years. 25 years! That’s older than some of you reading this post. His blog post delivers a very nice summary. (Thanks, Undeadly, Richard, Nega)

Posted by     Categories: Goings-on     1 Comment
1 Comment on Old, old bug

Respond | Trackback

  1. Lazarus says:

    Marc and worked out the issues and I am going to commit his fix, because
    it can’t hurt, but unfortunately there is a DragonFly-specific issue
    due to our modern readdir which translate directory entries into
    a filesystem-independant form.

    And, stupid me, when I created the dirent structure I didn’t add enough
    reserved fields to hold what we need, which is a full blown cookie for
    each entry. We only have 40 bits worth of unused fields and we need
    64 bits. I don’t dare change that structure now, it would require
    every single application ever written to be recompiled.

    It may be possible to store a filename hash in the unused fields and
    then match up against the hash instead of the buffer position. The
    problem with that though is that it would not be perfect or even close
    to perfect.”

    Anyone else think that said structure should just be increased to 64 bits from 40 so we can all be done with it? In a follow-up email it was suggested that this be done for DragonFly 2.0 despite the changes requiring a complete rebuild of third party programs.

    It seems to me to be the best way to go about things as DragonFly is in a good place right now; there’s plenty of people interested in it, but there is not such a massive installed base in existence requiring the developers to worry *too* much about not breaking things for the sake of backwards compatibility.

    I understand that my opinion matters little in a project I’m not actively involved in, but for what it’s worth, that’d be my vote. Fix it for 2.0 and rebuild apps as needed.

Respond

Comments

Comments