1. 10 Oct, 2024 1 commit
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.12-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 825ec756
      Linus Torvalds authored
      Pull xfs fixes from Carlos Maiolino:
      
       - A few small typo fixes
      
       - fstests xfs/538 DEBUG-only fix
      
       - Performance fix on blockgc on COW'ed files, by skipping trims on
         cowblock inodes currently opened for write
      
       - Prevent cowblocks to be freed under dirty pagecache during unshare
      
       - Update MAINTAINERS file to quote the new maintainer
      
      * tag 'xfs-6.12-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix a typo
        xfs: don't free cowblocks from under dirty pagecache on unshare
        xfs: skip background cowblock trims on inodes open for write
        xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc
        xfs: call xfs_bmap_exact_minlen_extent_alloc from xfs_bmap_btalloc
        xfs: don't ifdef around the exact minlen allocations
        xfs: fold xfs_bmap_alloc_userdata into xfs_bmapi_allocate
        xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname
        xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split
        xfs: return bool from xfs_attr3_leaf_add
        xfs: merge xfs_attr_leaf_try_add into xfs_attr_leaf_addname
        xfs: Use try_cmpxchg() in xlog_cil_insert_pcp_aggregate()
        xfs: scrub: convert comma to semicolon
        xfs: Remove empty declartion in header file
        MAINTAINERS: add Carlos Maiolino as XFS release manager
      825ec756
  2. 09 Oct, 2024 18 commits
  3. 08 Oct, 2024 4 commits
    • Linus Torvalds's avatar
      Merge tag 'sched_ext-for-6.12-rc2-fixes' of... · 75b607fa
      Linus Torvalds authored
      Merge tag 'sched_ext-for-6.12-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext
      
      Pull sched_ext fixes from Tejun Heo:
      
       - ops.enqueue() didn't have a way to tell whether select_task_rq_scx()
         and thus ops.select() were skipped. Some schedulers were incorrectly
         using SCX_ENQ_WAKEUP. Add SCX_ENQ_CPU_SELECTED and fix scx_qmap using
         it.
      
       - Remove a spurious WARN_ON_ONCE() in scx_cgroup_exit()
      
       - Fix error information clobbering during load
      
       - Add missing __weak markers to BPF helper declarations
      
       - Doc update
      
      * tag 'sched_ext-for-6.12-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
        sched_ext: Documentation: Update instructions for running example schedulers
        sched_ext, scx_qmap: Add and use SCX_ENQ_CPU_SELECTED
        sched/core: Add ENQUEUE_RQ_SELECTED to indicate whether ->select_task_rq() was called
        sched/core: Make select_task_rq() take the pointer to wake_flags instead of value
        sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()
        sched_ext: Improve error reporting during loading
        sched_ext: Add __weak markers to BPF helper function decalarations
      75b607fa
    • Devaansh-Kumar's avatar
      sched_ext: Documentation: Update instructions for running example schedulers · e0ed5215
      Devaansh-Kumar authored
      Since the artifact paths for tools changed, we need to update the documentation to reflect that path.
      Signed-off-by: default avatarDevaansh-Kumar <devaanshk840@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      e0ed5215
    • Linus Torvalds's avatar
      Merge tag 'ntfs3_for_6.12' of https://github.com/Paragon-Software-Group/linux-ntfs3 · 5b7c893e
      Linus Torvalds authored
      Pull ntfs3 updates from Konstantin Komarov:
      "New:
         - implement fallocate for compressed files
         - add support for the compression attribute
         - optimize large writes to sparse files
      
       Fixes:
         - fix several potential deadlock scenarios
         - fix various internal bugs detected by syzbot
         - add checks before accessing NTFS structures during parsing
         - correct the format of output messages
      
        Refactoring:
         - replace fsparam_flag_no with fsparam_flag in options parser
         - remove unused functions and macros"
      
      * tag 'ntfs3_for_6.12' of https://github.com/Paragon-Software-Group/linux-ntfs3: (25 commits)
        fs/ntfs3: Format output messages like others fs in kernel
        fs/ntfs3: Additional check in ntfs_file_release
        fs/ntfs3: Fix general protection fault in run_is_mapped_full
        fs/ntfs3: Sequential field availability check in mi_enum_attr()
        fs/ntfs3: Additional check in ni_clear()
        fs/ntfs3: Fix possible deadlock in mi_read
        ntfs3: Change to non-blocking allocation in ntfs_d_hash
        fs/ntfs3: Remove unused al_delete_le
        fs/ntfs3: Rename ntfs3_setattr into ntfs_setattr
        fs/ntfs3: Replace fsparam_flag_no -> fsparam_flag
        fs/ntfs3: Add support for the compression attribute
        fs/ntfs3: Implement fallocate for compressed files
        fs/ntfs3: Make checks in run_unpack more clear
        fs/ntfs3: Add rough attr alloc_size check
        fs/ntfs3: Stale inode instead of bad
        fs/ntfs3: Refactor enum_rstbl to suppress static checker
        fs/ntfs3: Fix sparse warning in ni_fiemap
        fs/ntfs3: Fix warning possible deadlock in ntfs_set_state
        fs/ntfs3: Fix sparse warning for bigendian
        fs/ntfs3: Separete common code for file_read/write iter/splice
        ...
      5b7c893e
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.12-1-2024-10-08' of... · b2760b83
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.12-1-2024-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix an assert() to handle captured and unprocessed ARM CoreSight CPU
         traces
      
       - Fix static build compilation error when libdw isn't installed or is
         too old
      
       - Add missing include when building with
         !HAVE_DWARF_GETLOCATIONS_SUPPORT
      
       - Add missing refcount put on 32-bit DSOs
      
       - Fix disassembly of user space binaries by setting the binary_type of
         DSO when loading
      
       - Update headers with the kernel sources, including asound.h, sched.h,
         fcntl, msr-index.h, irq_vectors.h, socket.h, list_sort.c and arm64's
         cputype.h
      
      * tag 'perf-tools-fixes-for-v6.12-1-2024-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
        perf cs-etm: Fix the assert() to handle captured and unprocessed cpu trace
        perf build: Fix build feature-dwarf_getlocations fail for old libdw
        perf build: Fix static compilation error when libdw is not installed
        perf dwarf-aux: Fix build with !HAVE_DWARF_GETLOCATIONS_SUPPORT
        tools headers arm64: Sync arm64's cputype.h with the kernel sources
        perf tools: Cope with differences for lib/list_sort.c copy from the kernel
        tools check_headers.sh: Add check variant that excludes some hunks
        perf beauty: Update copy of linux/socket.h with the kernel sources
        tools headers UAPI: Sync the linux/in.h with the kernel sources
        perf trace beauty: Update the arch/x86/include/asm/irq_vectors.h copy with the kernel sources
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        tools include UAPI: Sync linux/fcntl.h copy with the kernel sources
        tools include UAPI: Sync linux/sched.h copy with the kernel sources
        tools include UAPI: Sync sound/asound.h copy with the kernel sources
        perf vdso: Missed put on 32-bit dsos
        perf symbol: Set binary_type of dso when loading
      b2760b83
  4. 07 Oct, 2024 17 commits
    • Tejun Heo's avatar
      sched_ext, scx_qmap: Add and use SCX_ENQ_CPU_SELECTED · 9b671793
      Tejun Heo authored
      scx_qmap and other schedulers in the SCX repo are using SCX_ENQ_WAKEUP to
      tell whether ops.select_cpu() was called. This is incorrect as
      ops.select_cpu() can be skipped in the wakeup path and leads to e.g.
      incorrectly skipping direct dispatch for tasks that are bound to a single
      CPU.
      
      sched core has been updated to specify ENQUEUE_RQ_SELECTED if
      ->select_task_rq() was called. Map it to SCX_ENQ_CPU_SELECTED and update
      scx_qmap to test it instead of SCX_ENQ_WAKEUP.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDavid Vernet <void@manifault.com>
      Cc: Daniel Hodges <hodges.daniel.scott@gmail.com>
      Cc: Changwoo Min <multics69@gmail.com>
      Cc: Andrea Righi <andrea.righi@linux.dev>
      Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
      9b671793
    • Tejun Heo's avatar
      sched/core: Add ENQUEUE_RQ_SELECTED to indicate whether ->select_task_rq() was called · f207dc2d
      Tejun Heo authored
      During ttwu, ->select_task_rq() can be skipped if only one CPU is allowed or
      migration is disabled. sched_ext schedulers may perform operations such as
      direct dispatch from ->select_task_rq() path and it is useful for them to
      know whether ->select_task_rq() was skipped in the ->enqueue_task() path.
      
      Currently, sched_ext schedulers are using ENQUEUE_WAKEUP for this purpose
      and end up assuming incorrectly that ->select_task_rq() was called for tasks
      that are bound to a single CPU or migration disabled.
      
      Make select_task_rq() indicate whether ->select_task_rq() was called by
      setting WF_RQ_SELECTED in *wake_flags and make ttwu_do_activate() map that
      to ENQUEUE_RQ_SELECTED for ->enqueue_task().
      
      This will be used by sched_ext to fix ->select_task_rq() skip detection.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDavid Vernet <void@manifault.com>
      f207dc2d
    • Tejun Heo's avatar
      sched/core: Make select_task_rq() take the pointer to wake_flags instead of value · b62933ee
      Tejun Heo authored
      This will be used to allow select_task_rq() to indicate whether
      ->select_task_rq() was called by modifying *wake_flags.
      
      This makes try_to_wake_up() call all functions that take wake_flags with
      WF_TTWU set. Previously, only select_task_rq() was. Using the same flags is
      more consistent, and, as the flag is only tested by ->select_task_rq()
      implementations, it doesn't cause any behavior differences.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDavid Vernet <void@manifault.com>
      b62933ee
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 87d6aab2
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "Several small bugfixes all over the place.
      
        Most notably, fixes the vsock allocation with GFP_KERNEL in atomic
        context, which has been triggering warnings for lots of testers"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vhost/scsi: null-ptr-dereference in vhost_scsi_get_req()
        vsock/virtio: use GFP_ATOMIC under RCU read lock
        virtio_console: fix misc probe bugs
        virtio_ring: tag event_triggered as racy for KCSAN
        vdpa/octeon_ep: Fix format specifier for pointers in debug messages
      87d6aab2
    • Haoran Zhang's avatar
      vhost/scsi: null-ptr-dereference in vhost_scsi_get_req() · 221af82f
      Haoran Zhang authored
      Since commit 3f8ca2e1 ("vhost/scsi: Extract common handling code
      from control queue handler") a null pointer dereference bug can be
      triggered when guest sends an SCSI AN request.
      
      In vhost_scsi_ctl_handle_vq(), `vc.target` is assigned with
      `&v_req.tmf.lun[1]` within a switch-case block and is then passed to
      vhost_scsi_get_req() which extracts `vc->req` and `tpg`. However, for
      a `VIRTIO_SCSI_T_AN_*` request, tpg is not required, so `vc.target` is
      set to NULL in this branch. Later, in vhost_scsi_get_req(),
      `vc->target` is dereferenced without being checked, leading to a null
      pointer dereference bug. This bug can be triggered from guest.
      
      When this bug occurs, the vhost_worker process is killed while holding
      `vq->mutex` and the corresponding tpg will remain occupied
      indefinitely.
      
      Below is the KASAN report:
      Oops: general protection fault, probably for non-canonical address
      0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI
      KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
      CPU: 1 PID: 840 Comm: poc Not tainted 6.10.0+ #1
      Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS
      1.16.3-debian-1.16.3-2 04/01/2014
      RIP: 0010:vhost_scsi_get_req+0x165/0x3a0
      Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2b 02 00 00
      48 b8 00 00 00 00 00 fc ff df 4d 8b 65 30 4c 89 e2 48 c1 ea 03 <0f> b6
      04 02 4c 89 e2 83 e2 07 38 d0 7f 08 84 c0 0f 85 be 01 00 00
      RSP: 0018:ffff888017affb50 EFLAGS: 00010246
      RAX: dffffc0000000000 RBX: ffff88801b000000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888017affcb8
      RBP: ffff888017affb80 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
      R13: ffff888017affc88 R14: ffff888017affd1c R15: ffff888017993000
      FS:  000055556e076500(0000) GS:ffff88806b100000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000200027c0 CR3: 0000000010ed0004 CR4: 0000000000370ef0
      Call Trace:
       <TASK>
       ? show_regs+0x86/0xa0
       ? die_addr+0x4b/0xd0
       ? exc_general_protection+0x163/0x260
       ? asm_exc_general_protection+0x27/0x30
       ? vhost_scsi_get_req+0x165/0x3a0
       vhost_scsi_ctl_handle_vq+0x2a4/0xca0
       ? __pfx_vhost_scsi_ctl_handle_vq+0x10/0x10
       ? __switch_to+0x721/0xeb0
       ? __schedule+0xda5/0x5710
       ? __kasan_check_write+0x14/0x30
       ? _raw_spin_lock+0x82/0xf0
       vhost_scsi_ctl_handle_kick+0x52/0x90
       vhost_run_work_list+0x134/0x1b0
       vhost_task_fn+0x121/0x350
      ...
       </TASK>
      ---[ end trace 0000000000000000 ]---
      
      Let's add a check in vhost_scsi_get_req.
      
      Fixes: 3f8ca2e1 ("vhost/scsi: Extract common handling code from control queue handler")
      Signed-off-by: default avatarHaoran Zhang <wh1sper@zju.edu.cn>
      [whitespace fixes]
      Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
      Message-Id: <b26d7ddd-b098-4361-88f8-17ca7f90adf7@oracle.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      221af82f
    • Michael S. Tsirkin's avatar
      vsock/virtio: use GFP_ATOMIC under RCU read lock · a194c985
      Michael S. Tsirkin authored
      virtio_transport_send_pkt in now called on transport fast path,
      under RCU read lock. In that case, we have a bug: virtio_add_sgs
      is called with GFP_KERNEL, and might sleep.
      
      Pass the gfp flags as an argument, and use GFP_ATOMIC on
      the fast path.
      
      Link: https://lore.kernel.org/all/hfcr2aget2zojmqpr4uhlzvnep4vgskblx5b6xf2ddosbsrke7@nt34bxgp7j2x
      Fixes: efcd71af ("vsock/virtio: avoid queuing packets when intermediate queue is empty")
      Reported-by: default avatarChristian Brauner <brauner@kernel.org>
      Cc: Stefano Garzarella <sgarzare@redhat.com>
      Cc: Luigi Leonardi <luigi.leonardi@outlook.com>
      Message-ID: <3fbfb6e871f625f89eb578c7228e127437b1975a.1727876449.git.mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarPankaj Gupta <pankaj.gupta@amd.com>
      Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
      Reviewed-by: default avatarLuigi Leonardi <luigi.leonardi@outlook.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      a194c985
    • Brian Foster's avatar
      xfs: skip background cowblock trims on inodes open for write · 90a71daa
      Brian Foster authored
      The background blockgc scanner runs on a 5m interval by default and
      trims preallocation (post-eof and cow fork) from inodes that are
      otherwise idle. Idle effectively means that iolock can be acquired
      without blocking and that the inode has no dirty pagecache or I/O in
      flight.
      
      This simple mechanism and heuristic has worked fairly well for
      post-eof speculative preallocations. Support for reflink and COW
      fork preallocations came sometime later and plugged into the same
      mechanism, with similar heuristics. Some recent testing has shown
      that COW fork preallocation may be notably more sensitive to blockgc
      processing than post-eof preallocation, however.
      
      For example, consider an 8GB reflinked file with a COW extent size
      hint of 1MB. A worst case fully randomized overwrite of this file
      results in ~8k extents of an average size of ~1MB. If the same
      workload is interrupted a couple times for blockgc processing
      (assuming the file goes idle), the resulting extent count explodes
      to over 100k extents with an average size <100kB. This is
      significantly worse than ideal and essentially defeats the COW
      extent size hint mechanism.
      
      While this particular test is instrumented, it reflects a fairly
      reasonable pattern in practice where random I/Os might spread out
      over a large period of time with varying periods of (in)activity.
      For example, consider a cloned disk image file for a VM or container
      with long uptime and variable and bursty usage. A background blockgc
      scan that races and processes the image file when it happens to be
      clean and idle can have a significant effect on the future
      fragmentation level of the file, even when still in use.
      
      To help combat this, update the heuristic to skip cowblocks inodes
      that are currently opened for write access during non-sync blockgc
      scans. This allows COW fork preallocations to persist for as long as
      possible unless otherwise needed for functional purposes (i.e. a
      sync scan), the file is idle and closed, or the inode is being
      evicted from cache. While here, update the comments to help
      distinguish performance oriented heuristics from the logic that
      exists to maintain functional correctness.
      Suggested-by: default avatarDarrick Wong <djwong@kernel.org>
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      90a71daa
    • Christoph Hellwig's avatar
      xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc · 6aac7705
      Christoph Hellwig authored
      Currently the debug-only xfs_bmap_exact_minlen_extent_alloc allocation
      variant fails to drop into the lowmode last resort allocator, and
      thus can sometimes fail allocations for which the caller has a
      transaction block reservation.
      
      Fix this by using xfs_bmap_btalloc_low_space to do the actual allocation.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      6aac7705
    • Christoph Hellwig's avatar
      xfs: call xfs_bmap_exact_minlen_extent_alloc from xfs_bmap_btalloc · 405ee87c
      Christoph Hellwig authored
      xfs_bmap_exact_minlen_extent_alloc duplicates the args setup in
      xfs_bmap_btalloc.  Switch to call it from xfs_bmap_btalloc after
      doing the basic setup.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      405ee87c
    • Christoph Hellwig's avatar
      xfs: don't ifdef around the exact minlen allocations · b611fddc
      Christoph Hellwig authored
      Exact minlen allocations only exist as an error injection tool for debug
      builds.  Currently this is implemented using ifdefs, which means the code
      isn't even compiled for non-XFS_DEBUG builds.  Enhance the compile test
      coverage by always building the code and use the compilers' dead code
      elimination to remove it from the generated binary instead.
      
      The only downside is that the alloc_minlen_only field is unconditionally
      added to struct xfs_alloc_args now, but by moving it around and packing
      it tightly this doesn't actually increase the size of the structure.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      b611fddc
    • Christoph Hellwig's avatar
      xfs: fold xfs_bmap_alloc_userdata into xfs_bmapi_allocate · 865469cd
      Christoph Hellwig authored
      Userdata and metadata allocations end up in the same allocation helpers.
      Remove the separate xfs_bmap_alloc_userdata function to make this more
      clear.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      865469cd
    • Christoph Hellwig's avatar
      xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname · b3f4e84e
      Christoph Hellwig authored
      Just like xfs_attr3_leaf_split, xfs_attr_node_try_addname can return
      -ENOSPC both for an actual failure to allocate a disk block, but also
      to signal the caller to convert the format of the attr fork.  Use magic
      1 to ask for the conversion here as well.
      
      Note that unlike the similar issue in xfs_attr3_leaf_split, this one was
      only found by code review.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      b3f4e84e
    • Christoph Hellwig's avatar
      xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split · a5f73342
      Christoph Hellwig authored
      xfs_attr3_leaf_split propagates the need for an extra btree split as
      -ENOSPC to it's only caller, but the same return value can also be
      returned from xfs_da_grow_inode when it fails to find free space.
      
      Distinguish the two cases by returning 1 for the extra split case instead
      of overloading -ENOSPC.
      
      This can be triggered relatively easily with the pending realtime group
      support and a file system with a lot of small zones that use metadata
      space on the main device.  In this case every about 5-10th run of
      xfs/538 runs into the following assert:
      
      	ASSERT(oldblk->magic == XFS_ATTR_LEAF_MAGIC);
      
      in xfs_attr3_leaf_split caused by an allocation failure.  Note that
      the allocation failure is caused by another bug that will be fixed
      subsequently, but this commit at least sorts out the error handling.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      a5f73342
    • Christoph Hellwig's avatar
      xfs: return bool from xfs_attr3_leaf_add · 346c1d46
      Christoph Hellwig authored
      xfs_attr3_leaf_add only has two potential return values, indicating if the
      entry could be added or not.  Replace the errno return with a bool so that
      ENOSPC from it can't easily be confused with a real ENOSPC.
      
      Remove the return value from the xfs_attr3_leaf_add_work helper entirely,
      as it always return 0.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      346c1d46
    • Christoph Hellwig's avatar
      xfs: merge xfs_attr_leaf_try_add into xfs_attr_leaf_addname · b1c649da
      Christoph Hellwig authored
      xfs_attr_leaf_try_add is only called by xfs_attr_leaf_addname, and
      merging the two will simplify a following error handling fix.
      
      To facilitate this move the remote block state save/restore helpers up in
      the file so that they don't need forward declarations now.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      b1c649da
    • Uros Bizjak's avatar
      xfs: Use try_cmpxchg() in xlog_cil_insert_pcp_aggregate() · 20195d01
      Uros Bizjak authored
      Use !try_cmpxchg instead of cmpxchg (*ptr, old, new) != old in
      xlog_cil_insert_pcp_aggregate().  x86 CMPXCHG instruction returns
      success in ZF flag, so this change saves a compare after cmpxchg.
      
      Also, try_cmpxchg implicitly assigns old *ptr value to "old" when
      cmpxchg fails. There is no need to re-read the value in the loop.
      
      Note that the value from *ptr should be read using READ_ONCE to
      prevent the compiler from merging, refetching or reordering the read.
      
      No functional change intended.
      Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@infradead.org>
      Cc: Chandan Babu R <chandan.babu@oracle.com>
      Cc: Darrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      20195d01
    • Yan Zhen's avatar
      xfs: scrub: convert comma to semicolon · 6148b779
      Yan Zhen authored
      Replace a comma between expression statements by a semicolon.
      Signed-off-by: default avatarYan Zhen <yanzhen@vivo.com>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
      6148b779