Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-93648

udev "trigger" leads to remove PTP symlinks [rhel-8]

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • rhel-8.10, rhel-8.10.z
    • systemd
    • No
    • Low
    • rhel-plumbers
    • ssg_core_services
    • 2
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None

      What were you trying to do that didn't work?

      Some post-installation scripts execute udevadm trigger internally (which lead to a "change" event).
      This leads to removing PTP symlinks, e.g.:

      # modprobe ptp_kvm
      # ll /dev/ptp*
      crw-------. 1 root root 249, 0 Sep 17 09:51 /dev/ptp0
      lrwxrwxrwx. 1 root root      4 Sep 17 09:51 /dev/ptp_kvm -> ptp0
      # udevadm trigger
      # ll /dev/ptp*
      crw-------. 1 root root 249, 0 Sep 17 09:51 /dev/ptp0
      

      The PTP symlink is created only on ADD event, as per /lib/udev/rules.d/50-udev-default.rules rules:

       16 ACTION!="add", GOTO="default_end"
      
       84 SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"
       85 
       86 SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv"
       87 
       88 LABEL="default_end"
      

      What is unclear to me is why a CHANGE event deletes the symlink, it seems there is some reference tracking issue here.
      Through enabling debug log level, we can indeed see that the symlink is detected as "not belonging" to the device anymore, somehow:

      systemd-udevd[38299]: update old name, '/dev/ptp_kvm' no longer belonging to '/devices/virtual/ptp/ptp0'
      systemd-udevd[38299]: no reference left, remove '/dev/ptp_kvm'
      systemd-udevd[38299]: handling device node '/dev/ptp0', devnum=c249:0, mode=0600, uid=0, gid=0
      systemd-udevd[38299]: preserve already existing symlink '/dev/char/249:0' to '../ptp0'
      
      

      What is the impact of this issue to you?

      PTP not functional anymore

      Please provide the package NVR for which the bug is seen:

      systemd-239-82.el8_10.1

      How reproducible is this bug?:

      Steps to reproduce

      1.  Always
        # modprobe ptp_kvm
        # ll /dev/ptp*
        crw-------. 1 root root 249, 0 Sep 17 09:51 /dev/ptp0
        lrwxrwxrwx. 1 root root      4 Sep 17 09:51 /dev/ptp_kvm -> ptp0
        # udevadm trigger
        # ll /dev/ptp*
        crw-------. 1 root root 249, 0 Sep 17 09:51 /dev/ptp0
        

      Expected results

      Symlink persisting on CHANGE event.

      Actual results

      Symlink being removed.

              dtardon@redhat.com David Tardon
              rhn-support-rmetrich Renaud Métrich
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: