Menu

#1 probeDetect recursion

open-accepted
nobody
None
5
2010-10-11
2010-10-06
Anonymous
No

sometimes partitioned device cause infinite recursion.
e.g.: when system tries to mount da0,
destroy event generated for da0s1, which triggers another update of automounter (and another probe of da0)

patch included works at least for me.

FreeBSD 8.1-STABLE #11 r213048

Discussion

  • Nobody/Anonymous

    patch

     
  • Kamikaze Dominic Fandrey

    Accessing not properly aligned slices/partitions causes the kernel to send DEVD cdev (change device) events, even though nothing changes. This leads automounter into a race with the kernel. In my opinion this behaviour from the kernel is, if not a bug, at least not useful.

    The next version of automounter will have race condition detection to reduce the impact of this problem. Thank you for your report.

     
  • Kamikaze Dominic Fandrey

    • status: open --> open-accepted
     
  • Kamikaze Dominic Fandrey

    I just looked at your patch, and I think I understand the issue and that it's actually my fault, now.

    You filter direct device access, which breaks the use case where you just newfs -U /dev/da0 your device. There's no reason to have a partition table if you only have a single file system. Actually, my audio player came shipped with a dedicated msdosfs file system. So this is a real world use case.

    However your patch has inspired me to sort devices in the right order not to trigger the problem.

     
  • Kamikaze Dominic Fandrey

    Looked closer at your patch, I see now that it's more clever than I gave it credit.

    BTW, why do you work on column 11? The devices are in column 10.

    Can you give me a name or a nick to put in my THANKS documentation?

     
  • Nobody/Anonymous

    11th column, because awk -F' +' consider first column to be empty line before first space

    my nick Dioksin

     
  • Kamikaze Dominic Fandrey

    I couldn't resist the opportunity to throw away all the grep, sort and tail stuff and just build kind of a tree of device nodes in awk and limiting the output to leaf nodes.

    And while I'm at it I only look at stuff that isn't mounted.

    I found a second race condition, which I also fixed along the way, if you want to test it, you can find the patch to the port here:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=151402

    I'd be glad about feedback whether everything works as expected.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.