1. Mar 06, 2024
    • Zhao Chen's avatar
      fuse: Introduce a new notification type for resend pending requests · 760eac73
      Zhao Chen authored
      
      
      When a FUSE daemon panics and failover, we aim to minimize the impact on
      applications by reusing the existing FUSE connection. During this process,
      another daemon is employed to preserve the FUSE connection's file
      descriptor. The new started FUSE Daemon will takeover the fd and continue
      to provide service.
      
      However, it is possible for some inflight requests to be lost and never
      returned. As a result, applications awaiting replies would become stuck
      forever. To address this, we can resend these pending requests to the
      new started FUSE daemon.
      
      This patch introduces a new notification type "FUSE_NOTIFY_RESEND", which
      can trigger resending of the pending requests, ensuring they are properly
      processed again.
      
      Signed-off-by: default avatarZhao Chen <winters.zc@antgroup.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      760eac73
    • Jingbo Xu's avatar
      fuse: add support for explicit export disabling · e022f6a1
      Jingbo Xu authored
      
      
      open_by_handle_at(2) can fail with -ESTALE with a valid handle returned
      by a previous name_to_handle_at(2) for evicted fuse inodes, which is
      especially common when entry_valid_timeout is 0, e.g. when the fuse
      daemon is in "cache=none" mode.
      
      The time sequence is like:
      
      	name_to_handle_at(2)	# succeed
      	evict fuse inode
      	open_by_handle_at(2)	# fail
      
      The root cause is that, with 0 entry_valid_timeout, the dput() called in
      name_to_handle_at(2) will trigger iput -> evict(), which will send
      FUSE_FORGET to the daemon.  The following open_by_handle_at(2) will send
      a new FUSE_LOOKUP request upon inode cache miss since the previous inode
      eviction.  Then the fuse daemon may fail the FUSE_LOOKUP request with
      -ENOENT as the cached metadata of the requested inode has already been
      cleaned up during the previous FUSE_FORGET.  The returned -ENOENT is
      treated as -ESTALE when open_by_handle_at(2) returns.
      
      This confuses the application somehow, as open_by_handle_at(2) fails
      when the previous name_to_handle_at(2) succeeds.  The returned errno is
      also confusing as the requested file is not deleted and already there.
      It is reasonable to fail name_to_handle_at(2) early in this case, after
      which the application can fallback to open(2) to access files.
      
      Since this issue typically appears when entry_valid_timeout is 0 which
      is configured by the fuse daemon, the fuse daemon is the right person to
      explicitly disable the export when required.
      
      Also considering FUSE_EXPORT_SUPPORT actually indicates the support for
      lookups of "." and "..", and there are existing fuse daemons supporting
      export without FUSE_EXPORT_SUPPORT set, for compatibility, we add a new
      INIT flag for such purpose.
      
      Reviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      e022f6a1
    • Alexander Mikhalitsyn's avatar
      fuse: __kuid_val/__kgid_val helpers in fuse_fill_attr_from_inode() · 5a4d888e
      Alexander Mikhalitsyn authored
      
      
      For the sake of consistency, let's use these helpers to extract
      {u,g}id_t values from k{u,g}id_t ones.
      
      There are no functional changes, just to make code cleaner.
      
      Signed-off-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
      Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      5a4d888e
    • Alexander Mikhalitsyn's avatar
      fuse: fix typo for fuse_permission comment · 2d09ab22
      Alexander Mikhalitsyn authored
      
      
      Found by chance while working on support for idmapped mounts in fuse.
      
      Signed-off-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      2d09ab22
  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
    • Linus Torvalds's avatar
      Merge tag 'bcachefs-2024-02-17' of https://evilpiepirate.org/git/bcachefs · f2667e0c
      Linus Torvalds authored
      Pull bcachefs fixes from Kent Overstreet:
       "Mostly pretty trivial, the user visible ones are:
      
         - don't barf when replicas_required > replicas
      
         - fix check_version_upgrade() so it doesn't do something nonsensical
           when we're downgrading"
      
      * tag 'bcachefs-2024-02-17' of https://evilpiepirate.org/git/bcachefs:
        bcachefs: Fix missing va_end()
        bcachefs: Fix check_version_upgrade()
        bcachefs: Clamp replicas_required to replicas
        bcachefs: fix missing endiannes conversion in sb_members
        bcachefs: fix kmemleak in __bch2_read_super error handling path
        bcachefs: Fix missing bch2_err_class() calls
      f2667e0c
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · ced59052
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are some driver core fixes, a kobject fix, and a documentation
        update for 6.8-rc5. In detail these changes are:
      
         - devlink fixes for reported issues with 6.8-rc1
      
         - topology scheduling regression fix that has been reported by many
      
         - kobject loosening of checks change in -rc1 is now reverted as some
           codepaths seemed to need the checks
      
         - documentation update for the CVE process. Has been reviewed by
           many, the last minute change to the document was to bring the .rst
           format back into the the new style rules, the contents did not
           change.
      
        All of these, except for the documentation update, have been in
        linux-next for over a week. The documentation update has been reviewed
        for weeks by a group of developers, and in public for a week and the
        wording has stabilized for now. If future changes are needed, we can
        do so before 6.8-final is out (or anytime after that)"
      
      * tag 'driver-core-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        Documentation: Document the Linux Kernel CVE process
        Revert "kobject: Remove redundant checks for whether ktype is NULL"
        driver core: fw_devlink: Improve logs for cycle detection
        driver core: fw_devlink: Improve detection of overlapping cycles
        driver core: Fix device_link_flag_is_sync_state_only()
        topology: Set capacity_freq_ref in all cases
      ced59052