1. Mar 06, 2024
  2. Mar 05, 2024
  3. Feb 24, 2024
  4. Feb 23, 2024
    • Stefan Hajnoczi's avatar
      virtiofs: emit uevents on filesystem events · 9086b2d9
      Stefan Hajnoczi authored
      
      
      Alyssa Ross <hi@alyssa.is> requested that virtiofs notifies userspace
      when filesytems become available. This can be used to detect when a
      filesystem with a given tag is hotplugged, for example. uevents allow
      userspace to detect changes without resorting to polling.
      
      The tag is included as a uevent property so it's easy for userspace to
      identify the filesystem in question even when the sysfs directory goes
      away during removal.
      
      Here are example uevents:
      
        # udevadm monitor -k -p
      
        KERNEL[111.113221] add      /fs/virtiofs/2 (virtiofs)
        ACTION=add
        DEVPATH=/fs/virtiofs/2
        SUBSYSTEM=virtiofs
        TAG=test
      
        KERNEL[165.527167] remove   /fs/virtiofs/2 (virtiofs)
        ACTION=remove
        DEVPATH=/fs/virtiofs/2
        SUBSYSTEM=virtiofs
        TAG=test
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      9086b2d9
    • Stefan Hajnoczi's avatar
      virtiofs: export filesystem tags through sysfs · a8f62f50
      Stefan Hajnoczi authored
      The virtiofs filesystem is mounted using a "tag" which is exported by
      the virtiofs device:
      
        # mount -t virtiofs <tag> /mnt
      
      The virtiofs driver knows about all the available tags but these are
      currently not exported to user space.
      
      People have asked for these tags to be exported to user space. Most
      recently Lennart Poettering has asked for it as he wants to scan the
      tags and mount virtiofs automatically in certain cases.
      
      https://gitlab.com/virtio-fs/virtiofsd/-/issues/128
      
      
      
      This patch exports tags at /sys/fs/virtiofs/<N>/tag where N is the id of
      the virtiofs device. The filesystem tag can be obtained by reading this
      "tag" file.
      
      There is also a symlink at /sys/fs/virtiofs/<N>/device that points to
      the virtiofs device that exports this tag.
      
      This patch converts the existing struct virtio_fs into a full kobject.
      It already had a refcount so it's an easy change. The virtio_fs objects
      can then be exposed in a kset at /sys/fs/virtiofs/. Note that virtio_fs
      objects may live slightly longer than we wish for them to be exposed to
      userspace, so kobject_del() is called explicitly when the underlying
      virtio_device is removed. The virtio_fs object is freed when all
      references are dropped (e.g. active mounts) but disappears as soon as
      the virtiofs device is gone.
      
      Originally-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      a8f62f50
    • Stefan Hajnoczi's avatar
      virtiofs: forbid newlines in tags · 40488cc1
      Stefan Hajnoczi authored
      
      
      Newlines in virtiofs tags are awkward for users and potential vectors
      for string injection attacks.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      40488cc1
  5. Feb 19, 2024
  6. Feb 18, 2024
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · c02197fc
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "This is a bit of a big batch for rc4, but just due to holiday hangover
        and because I didn't send any fixes last week due to a late revert
        request. I think next week should be back to normal.
      
         - Fix ftrace bug on boot caused by exit text sections with
           '-fpatchable-function-entry'
      
         - Fix accuracy of stolen time on pseries since the switch to
           VIRT_CPU_ACCOUNTING_GEN
      
         - Fix a crash in the IOMMU code when doing DLPAR remove
      
         - Set pt_regs->link on scv entry to fix BPF stack unwinding
      
         - Add missing PPC_FEATURE_BOOKE on 64-bit e5500/e6500, which broke
           gdb
      
         - Fix boot on some 6xx platforms with STRICT_KERNEL_RWX enabled
      
         - Fix build failures with KASAN enabled and 32KB stack size
      
         - Some other minor fixes
      
        Thanks to Arnd Bergmann, Benjamin Gray, Christophe Leroy, David
        Engraf, Gaurav Batra, Jason Gunthorpe, Jiangfeng Xiao, Matthias
        Schiffer, Nathan Lynch, Naveen N Rao, Nicholas Piggin, Nysal Jan K.A,
        R Nageswara Sastry, Shivaprasad G Bhat, Shrikanth Hegde, Spoorthy,
        Srikar Dronamraju, and Venkat Rao Bagalkote"
      
      * tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/iommu: Fix the missing iommu_group_put() during platform domain attach
        powerpc/pseries: fix accuracy of stolen time
        powerpc/ftrace: Ignore ftrace locations in exit text sections
        powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E
        powerpc/kasan: Limit KASAN thread size increase to 32KB
        Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add"
        powerpc: 85xx: mark local functions static
        powerpc: udbg_memcons: mark functions static
        powerpc/kasan: Fix addr error caused by page alignment
        powerpc/6xx: set High BAT Enable flag on G2_LE cores
        selftests/powerpc/papr_vpd: Check devfd before get_system_loc_code()
        powerpc/64: Set task pt_regs->link to the LR value on scv entry
        powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add
        powerpc/pseries/papr-sysparm: use u8 arrays for payloads
      c02197fc