cvs commit: src/sys/geom geom_event.c

Pawel Jakub Dawidek pjd at
Thu Sep 27 13:18:34 PDT 2007

pjd         2007-09-27 20:18:34 UTC

  FreeBSD src repository

  Modified files:
    sys/geom             geom_event.c 
  When orphaning a provider, cancel events related to it.
  Without this change the following situation was possible:
  1. Provider is orphaned from within class' access() method on last write
     close - orphan provider event is send.
  2. GEOM detects last write close on a provider and sends new provider event.
  3. g_orphan_register() is called, and calls all orphan methods of attached
  4. New provider event is executed on orphaned provider, all classes can
     taste already orphaned provider, and some may attach consumers to it.
     Those consumers will never go away, because the g_orphan_register()
     was already called.
  We end up with a zombie provider.
  With this change, at step 3, we will cancel new provider event.
  How to repeat this problem:
          # mdconfig -a -t malloc -s 10m
          # geli init -i 0 md0
          # geli attach md0
          # newfs -L test /dev/md0.eli
          # mount /dev/ufs/test /mnt/tmp
          # geli detach -l md0.eli
          # umount /mnt/tmp
          # glabel status
              Name  Status  Components
          ufs/test  N/A     N/A
  Reviewed by:    phk
  Approved by:    re (kensmith)
  Revision  Changes    Path
  1.56      +2 -0      src/sys/geom/geom_event.c

More information about the cvs-src mailing list