1. 05 Mar, 2024 9 commits
    • Miklos Szeredi's avatar
      fuse: fix root lookup with nonzero generation · 68ca1b49
      Miklos Szeredi authored
      The root inode has a fixed nodeid and generation (1, 0).
      
      Prior to the commit 15db1683 ("fuse: fix illegal access to inode with
      reused nodeid") generation number on lookup was ignored.  After this commit
      lookup with the wrong generation number resulted in the inode being
      unhashed.  This is correct for non-root inodes, but replacing the root
      inode is wrong and results in weird behavior.
      
      Fix by reverting to the old behavior if ignoring the generation for the
      root inode, but issuing a warning in dmesg.
      Reported-by: default avatarAntonio SJ Musumeci <trapexit@spawn.link>
      Closes: https://lore.kernel.org/all/CAOQ4uxhek5ytdN8Yz2tNEOg5ea4NkBb4nk0FGPjPk_9nz-VG3g@mail.gmail.com/
      Fixes: 15db1683 ("fuse: fix illegal access to inode with reused nodeid")
      Cc: <stable@vger.kernel.org> # v5.14
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      68ca1b49
    • Miklos Szeredi's avatar
      fuse: replace remaining make_bad_inode() with fuse_make_bad() · 82e081ae
      Miklos Szeredi authored
      fuse_do_statx() was added with the wrong helper.
      
      Fixes: d3045530 ("fuse: implement statx")
      Cc: <stable@vger.kernel.org> # v6.6
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      82e081ae
    • Stefan Hajnoczi's avatar
      virtiofs: drop __exit from virtio_fs_sysfs_exit() · d30ff898
      Stefan Hajnoczi authored
      virtio_fs_sysfs_exit() is called by:
      - static int __init virtio_fs_init(void)
      - static void __exit virtio_fs_exit(void)
      
      Remove __exit from virtio_fs_sysfs_exit() since virtio_fs_init() is not
      an __exit function.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202402270649.GYjNX0yw-lkp@intel.com/Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      d30ff898
    • Amir Goldstein's avatar
      fuse: implement passthrough for mmap · fda0b98e
      Amir Goldstein authored
      An mmap request for a file open in passthrough mode, maps the memory
      directly to the backing file.
      
      An mmap of a file in direct io mode, usually uses cached mmap and puts
      the inode in caching io mode, which denies new passthrough opens of that
      inode, because caching io mode is conflicting with passthrough io mode.
      
      For the same reason, trying to mmap a direct io file, while there is
      a passthrough file open on the same inode will fail with -ENODEV.
      
      An mmap of a file in direct io mode, also needs to wait for parallel
      dio writes in-progress to complete.
      
      If a passthrough file is opened, while an mmap of another direct io
      file is waiting for parallel dio writes to complete, the wait is aborted
      and mmap fails with -ENODEV.
      
      A FUSE server that uses passthrough and direct io opens on the same inode
      that may also be mmaped, is advised to provide a backing fd also for the
      files that are open in direct io mode (i.e. use the flags combination
      FOPEN_DIRECT_IO | FOPEN_PASSTHROUGH), so that mmap will always use the
      backing file, even if read/write do not passthrough.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      fda0b98e
    • Amir Goldstein's avatar
      fuse: implement splice read/write passthrough · 5ca73468
      Amir Goldstein authored
      This allows passing fstests generic/249 and generic/591.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      5ca73468
    • Amir Goldstein's avatar
      fuse: implement read/write passthrough · 57e1176e
      Amir Goldstein authored
      Use the backing file read/write helpers to implement read/write
      passthrough to a backing file.
      
      After read/write, we invalidate a/c/mtime/size attributes.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      57e1176e
    • Amir Goldstein's avatar
      fuse: implement open in passthrough mode · 4a90451b
      Amir Goldstein authored
      After getting a backing file id with FUSE_DEV_IOC_BACKING_OPEN ioctl,
      a FUSE server can reply to an OPEN request with flag FOPEN_PASSTHROUGH
      and the backing file id.
      
      The FUSE server should reuse the same backing file id for all the open
      replies of the same FUSE inode and open will fail (with -EIO) if a the
      server attempts to open the same inode with conflicting io modes or to
      setup passthrough to two different backing files for the same FUSE inode.
      Using the same backing file id for several different inodes is allowed.
      
      Opening a new file with FOPEN_DIRECT_IO for an inode that is already
      open for passthrough is allowed, but only if the FOPEN_PASSTHROUGH flag
      and correct backing file id are specified as well.
      
      The read/write IO of such files will not use passthrough operations to
      the backing file, but mmap, which does not support direct_io, will use
      the backing file insead of using the page cache as it always did.
      
      Even though all FUSE passthrough files of the same inode use the same
      backing file as a backing inode reference, each FUSE file opens a unique
      instance of a backing_file object to store the FUSE path that was used
      to open the inode and the open flags of the specific open file.
      
      The per-file, backing_file object is released along with the FUSE file.
      The inode associated fuse_backing object is released when the last FUSE
      passthrough file of that inode is released AND when the backing file id
      is closed by the server using the FUSE_DEV_IOC_BACKING_CLOSE ioctl.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      4a90451b
    • Amir Goldstein's avatar
      fuse: prepare for opening file in passthrough mode · fc8ff397
      Amir Goldstein authored
      In preparation for opening file in passthrough mode, store the
      fuse_open_out argument in ff->args to be passed into fuse_file_io_open()
      with the optional backing_id member.
      
      This will be used for setting up passthrough to backing file on open
      reply with FOPEN_PASSTHROUGH flag and a valid backing_id.
      
      Opening a file in passthrough mode may fail for several reasons, such as
      missing capability, conflicting open flags or inode in caching mode.
      Return EIO from fuse_file_io_open() in those cases.
      
      The combination of FOPEN_PASSTHROUGH and FOPEN_DIRECT_IO is allowed -
      it mean that read/write operations will go directly to the server,
      but mmap will be done to the backing file.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      fc8ff397
    • Amir Goldstein's avatar
      fuse: implement ioctls to manage backing files · 44350256
      Amir Goldstein authored
      FUSE server calls the FUSE_DEV_IOC_BACKING_OPEN ioctl with a backing file
      descriptor.  If the call succeeds, a backing file identifier is returned.
      
      A later change will be using this backing file id in a reply to OPEN
      request with the flag FOPEN_PASSTHROUGH to setup passthrough of file
      operations on the open FUSE file to the backing file.
      
      The FUSE server should call FUSE_DEV_IOC_BACKING_CLOSE ioctl to close the
      backing file by its id.
      
      This can be done at any time, but if an open reply with FOPEN_PASSTHROUGH
      flag is still in progress, the open may fail if the backing file is
      closed before the fuse file was opened.
      
      Setting up backing files requires a server with CAP_SYS_ADMIN privileges.
      For the backing file to be successfully setup, the backing file must
      implement both read_iter and write_iter file operations.
      
      The limitation on the level of filesystem stacking allowed for the
      backing file is enforced before setting up the backing file.
      Signed-off-by: default avatarAlessio Balsini <balsini@android.com>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      44350256
  2. 23 Feb, 2024 14 commits
  3. 18 Feb, 2024 6 commits
    • Linus Torvalds's avatar
      Linux 6.8-rc5 · b401b621
      Linus Torvalds authored
      b401b621
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.8-2' of... · 6c160f16
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Reformat nested if-conditionals in Makefiles with 4 spaces
      
       - Fix CONFIG_DEBUG_INFO_BTF builds for big endian
      
       - Fix modpost for module srcversion
      
       - Fix an escape sequence warning in gen_compile_commands.py
      
       - Fix kallsyms to ignore ARMv4 thunk symbols
      
      * tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kallsyms: ignore ARMv4 thunks along with others
        modpost: trim leading spaces when processing source files list
        gen_compile_commands: fix invalid escape sequence warning
        kbuild: Fix changing ELF file type for output of gen_btf for big endian
        docs: kconfig: Fix grammar and formatting
        kbuild: use 4-space indentation when followed by conditionals
      6c160f16
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ddac3d8b
      Linus Torvalds authored
      Pull x86 fix from Borislav Petkov:
      
       - Use a GB page for identity mapping only when memory of this size is
         requested so that mapping of reserved regions is prevented which
         would otherwise lead to system crashes on UV machines
      
      * tag 'x86_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
      ddac3d8b
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7cb7c32d
      Linus Torvalds authored
      Pull irq fixes from Borislav Petkov:
      
       - Fix GICv4.1 affinity update
      
       - Restore a quirk for ACPI-based GICv4 systems
      
       - Handle non-coherent GICv4 redistributors properly
      
       - Prevent spurious interrupts on Broadcom devices using GIC v3
         architecture
      
       - Other minor fixes
      
      * tag 'irq_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update
        irqchip/gic-v3-its: Restore quirk probing for ACPI-based systems
        irqchip/gic-v3-its: Handle non-coherent GICv4 redistributors
        irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
        irqchip/loongson-eiointc: Use correct struct type in eiointc_domain_alloc()
        irqchip/irq-brcmstb-l2: Add write memory barrier before exit
      7cb7c32d
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 626721ed
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Two fixes for i801 and qcom-geni devices. Meanwhile, a fix from Arnd
        addresses a compilation error encountered during compile test on
        powerpc"
      
      * tag 'i2c-for-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: i801: Fix block process call transactions
        i2c: pasemi: split driver into two separate modules
        i2c: qcom-geni: Correct I2C TRE sequence
      626721ed
    • 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
  4. 17 Feb, 2024 11 commits