1. 02 Jul, 2024 18 commits
    • Darrick J. Wong's avatar
      xfs: create libxfs helper to link an existing inode into a directory · c1f0bad4
      Darrick J. Wong authored
      Create a new libxfs function to link an existing inode into a directory.
      The upcoming metadata directory feature will need this to create a
      metadata directory tree.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      c1f0bad4
    • Darrick J. Wong's avatar
      xfs: create libxfs helper to link a new inode into a directory · 1fa2e819
      Darrick J. Wong authored
      Create a new libxfs function to link a newly created inode into a
      directory.  The upcoming metadata directory feature will need this to
      create a metadata directory tree.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      1fa2e819
    • Darrick J. Wong's avatar
      xfs: separate the icreate logic around INIT_XATTRS · b11b11e3
      Darrick J. Wong authored
      INIT_XATTRS is overloaded here -- it's set during the creat process when
      we think that we're immediately going to set some ACL xattrs to save
      time.  However, it's also used by the parent pointers code to enable the
      attr fork in preparation to receive ppptr xattrs.  This results in
      xfs_has_parent() branches scattered around the codebase to turn on
      INIT_XATTRS.
      
      Linkable files are created far more commonly than unlinkable temporary
      files or directory tree roots, so we should centralize this logic in
      xfs_inode_init.  For the three callers that don't want parent pointers
      (online repiar tempfiles, unlinkable tempfiles, rootdir creation) we
      provide an UNLINKABLE flag to skip attr fork initialization.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      b11b11e3
    • Darrick J. Wong's avatar
      xfs: hoist xfs_{bump,drop}link to libxfs · a9e583d3
      Darrick J. Wong authored
      Move xfs_bumplink and xfs_droplink to libxfs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      a9e583d3
    • Darrick J. Wong's avatar
      xfs: hoist xfs_iunlink to libxfs · b8a61079
      Darrick J. Wong authored
      Move xfs_iunlink and xfs_iunlink_remove to libxfs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      b8a61079
    • Darrick J. Wong's avatar
      xfs: wrap inode creation dqalloc calls · c0223b8d
      Darrick J. Wong authored
      Create a helper that calls dqalloc to allocate and grab a reference to
      dquots for the user, group, and project ids listed in an icreate
      structure.  This simplifies the creat-related dqalloc callsites
      scattered around the code base.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      c0223b8d
    • Darrick J. Wong's avatar
      xfs: push xfs_icreate_args creation out of xfs_create* · dfaf8842
      Darrick J. Wong authored
      Move the initialization of the xfs_icreate_args structure out of
      xfs_create and xfs_create_tempfile into their callers so that we can set
      the new inode's attributes in one place and pass that through instead of
      open coding the collection of attributes all over the code.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      dfaf8842
    • Darrick J. Wong's avatar
      xfs: hoist new inode initialization functions to libxfs · e9d2b35b
      Darrick J. Wong authored
      Move all the code that initializes a new inode's attributes from the
      icreate_args structure and the parent directory into libxfs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      e9d2b35b
    • Darrick J. Wong's avatar
      xfs: split new inode creation into two pieces · 38fd3d6a
      Darrick J. Wong authored
      There are two parts to initializing a newly allocated inode: setting up
      the incore structures, and initializing the new inode core based on the
      parent inode and the current user's environment.  The initialization
      code is not specific to the kernel, so we would like to share that with
      userspace by hoisting it to libxfs.  Therefore, split xfs_icreate into
      separate functions to prepare for the next few patches.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      38fd3d6a
    • Darrick J. Wong's avatar
      xfs: use xfs_trans_ichgtime to set times when allocating inode · a7b12718
      Darrick J. Wong authored
      Use xfs_trans_ichgtime to set the inode times when allocating an inode,
      instead of open-coding them here.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      a7b12718
    • Darrick J. Wong's avatar
      xfs: implement atime updates in xfs_trans_ichgtime · 3d1dfb6d
      Darrick J. Wong authored
      Enable xfs_trans_ichgtime to change the inode access time so that we can
      use this function to set inode times when allocating inodes instead of
      open-coding it.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      3d1dfb6d
    • Darrick J. Wong's avatar
      xfs: pack icreate initialization parameters into a separate structure · ba4b39fe
      Darrick J. Wong authored
      Callers that want to create an inode currently pass all possible file
      attribute values for the new inode into xfs_init_new_inode as ten
      separate parameters.  This causes two code maintenance issues: first, we
      have large multi-line call sites which programmers must read carefully
      to make sure they did not accidentally invert a value.  Second, all
      three file id parameters must be passed separately to the quota
      functions; any discrepancy results in quota count errors.
      
      Clean this up by creating a new icreate_args structure to hold all this
      information, some helpers to initialize them properly, and make the
      callers pass this structure through to the creation function, whose name
      we shorten to xfs_icreate.  This eliminates the issues, enables us to
      keep the inode init code in sync with userspace via libxfs, and is
      needed for future metadata directory tree management.
      
      (A subsequent cleanup will also fix the quota alloc calls.)
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      ba4b39fe
    • Darrick J. Wong's avatar
      xfs: hoist project id get/set functions to libxfs · fcea5b35
      Darrick J. Wong authored
      Move the project id get and set functions into libxfs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      fcea5b35
    • Darrick J. Wong's avatar
      xfs: hoist inode flag conversion functions to libxfs · b7c477be
      Darrick J. Wong authored
      Hoist the inode flag conversion functions into libxfs so that we can
      keep them in sync.  Do this by creating a new xfs_inode_util.c file in
      libxfs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      b7c477be
    • Darrick J. Wong's avatar
      xfs: hoist extent size helpers to libxfs · acdddbe1
      Darrick J. Wong authored
      Move the extent size helpers to xfs_bmap.c in libxfs since they're used
      there already.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      acdddbe1
    • Darrick J. Wong's avatar
      xfs: move inode copy-on-write predicates to xfs_inode.[ch] · d76e1370
      Darrick J. Wong authored
      Move these inode predicate functions to xfs_inode.[ch] since they're not
      reflink functions.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      d76e1370
    • Darrick J. Wong's avatar
      xfs: use consistent uid/gid when grabbing dquots for inodes · 24a4e1cb
      Darrick J. Wong authored
      I noticed that callers of xfs_qm_vop_dqalloc use the following code to
      compute the anticipated uid of the new file:
      
      	mapped_fsuid(idmap, &init_user_ns);
      
      whereas the VFS uses a slightly different computation for actually
      assigning i_uid:
      
      	mapped_fsuid(idmap, i_user_ns(inode));
      
      Technically, these are not the same things.  According to Christian
      Brauner, the only time that inode->i_sb->s_user_ns != &init_user_ns is
      when the filesystem was mounted in a new mount namespace by an
      unpriviledged user.  XFS does not allow this, which is why we've never
      seen bug reports about quotas being incorrect or the uid checks in
      xfs_qm_vop_create_dqattach tripping debug assertions.
      
      However, this /is/ a logic bomb, so let's make the code consistent.
      
      Link: https://lore.kernel.org/linux-fsdevel/20240617-weitblick-gefertigt-4a41f37119fa@brauner/
      Fixes: c14329d3 ("fs: port fs{g,u}id helpers to mnt_idmap")
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      24a4e1cb
    • Darrick J. Wong's avatar
      xfs: verify buffer, inode, and dquot items every tx commit · 150bb10a
      Darrick J. Wong authored
      generic/388 has an annoying tendency to fail like this during log
      recovery:
      
      XFS (sda4): Unmounting Filesystem 435fe39b-82b6-46ef-be56-819499585130
      XFS (sda4): Mounting V5 Filesystem 435fe39b-82b6-46ef-be56-819499585130
      XFS (sda4): Starting recovery (logdev: internal)
      00000000: 49 4e 81 b6 03 02 00 00 00 00 00 07 00 00 00 07  IN..............
      00000010: 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 10  ................
      00000020: 35 9a 8b c1 3e 6e 81 00 35 9a 8b c1 3f dc b7 00  5...>n..5...?...
      00000030: 35 9a 8b c1 3f dc b7 00 00 00 00 00 00 3c 86 4f  5...?........<.O
      00000040: 00 00 00 00 00 00 02 f3 00 00 00 00 00 00 00 00  ................
      00000050: 00 00 1f 01 00 00 00 00 00 00 00 02 b2 74 c9 0b  .............t..
      00000060: ff ff ff ff d7 45 73 10 00 00 00 00 00 00 00 2d  .....Es........-
      00000070: 00 00 07 92 00 01 fe 30 00 00 00 00 00 00 00 1a  .......0........
      00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      00000090: 35 9a 8b c1 3b 55 0c 00 00 00 00 00 04 27 b2 d1  5...;U.......'..
      000000a0: 43 5f e3 9b 82 b6 46 ef be 56 81 94 99 58 51 30  C_....F..V...XQ0
      XFS (sda4): Internal error Bad dinode after recovery at line 539 of file fs/xfs/xfs_inode_item_recover.c.  Caller xlog_recover_items_pass2+0x4e/0xc0 [xfs]
      CPU: 0 PID: 2189311 Comm: mount Not tainted 6.9.0-rc4-djwx #rc4
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20171121_152543-x86-ol7-builder-01.us.oracle.com-4.el7.1 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0x4f/0x60
       xfs_corruption_error+0x90/0xa0
       xlog_recover_inode_commit_pass2+0x5f1/0xb00
       xlog_recover_items_pass2+0x4e/0xc0
       xlog_recover_commit_trans+0x2db/0x350
       xlog_recovery_process_trans+0xab/0xe0
       xlog_recover_process_data+0xa7/0x130
       xlog_do_recovery_pass+0x398/0x840
       xlog_do_log_recovery+0x62/0xc0
       xlog_do_recover+0x34/0x1d0
       xlog_recover+0xe9/0x1a0
       xfs_log_mount+0xff/0x260
       xfs_mountfs+0x5d9/0xb60
       xfs_fs_fill_super+0x76b/0xa30
       get_tree_bdev+0x124/0x1d0
       vfs_get_tree+0x17/0xa0
       path_mount+0x72b/0xa90
       __x64_sys_mount+0x112/0x150
       do_syscall_64+0x49/0x100
       entry_SYSCALL_64_after_hwframe+0x4b/0x53
       </TASK>
      XFS (sda4): Corruption detected. Unmount and run xfs_repair
      XFS (sda4): Metadata corruption detected at xfs_dinode_verify.part.0+0x739/0x920 [xfs], inode 0x427b2d1
      XFS (sda4): Filesystem has been shut down due to log error (0x2).
      XFS (sda4): Please unmount the filesystem and rectify the problem(s).
      XFS (sda4): log mount/recovery failed: error -117
      XFS (sda4): log mount failed
      
      This inode log item recovery failing the dinode verifier after
      replaying the contents of the inode log item into the ondisk inode.
      Looking back into what the kernel was doing at the time of the fs
      shutdown, a thread was in the middle of running a series of
      transactions, each of which committed changes to the inode.
      
      At some point in the middle of that chain, an invalid (at least
      according to the verifier) change was committed.  Had the filesystem not
      shut down in the middle of the chain, a subsequent transaction would
      have corrected the invalid state and nobody would have noticed.  But
      that's not what happened here.  Instead, the invalid inode state was
      committed to the ondisk log, so log recovery tripped over it.
      
      The actual defect here was an overzealous inode verifier, which was
      fixed in a separate patch.  This patch adds some transaction precommit
      functions for CONFIG_XFS_DEBUG=y mode so that we can detect these kinds
      of transient errors at transaction commit time, where it's much easier
      to find the root cause.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      150bb10a
  2. 01 Jul, 2024 13 commits
  3. 30 Jun, 2024 9 commits
    • Linus Torvalds's avatar
      Linux 6.10-rc6 · 22a40d14
      Linus Torvalds authored
      22a40d14
    • Linus Torvalds's avatar
      Merge tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux · aca7c377
      Linus Torvalds authored
      Pull ata fixes from Niklas Cassel:
      
       - Add NOLPM quirk for for all Crucial BX SSD1 models.
      
         Considering that we now have had bug reports for 3 different BX SSD1
         variants from Crucial with the same product name, make the quirk more
         inclusive, to catch more device models from the same generation.
      
       - Fix a trivial NULL pointer dereference in the error path for
         ata_host_release().
      
       - Create a ata_port_free(), so that we don't miss freeing ata_port
         struct members when freeing a struct ata_port.
      
       - Fix a trivial double free in the error path for ata_host_alloc().
      
       - Ensure that we remove the libata "remapped NVMe device count" sysfs
         entry on .probe() error.
      
      * tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
        ata: ahci: Clean up sysfs file on error
        ata: libata-core: Fix double free on error
        ata,scsi: libata-core: Do not leak memory for ata_port struct members
        ata: libata-core: Fix null pointer dereference on error
        ata: libata-core: Add ATA_HORKAGE_NOLPM for all Crucial BX SSD1 models
      aca7c377
    • Niklas Cassel's avatar
      ata: ahci: Clean up sysfs file on error · eeb25a09
      Niklas Cassel authored
      .probe() (ahci_init_one()) calls sysfs_add_file_to_group(), however,
      if probe() fails after this call, we currently never call
      sysfs_remove_file_from_group().
      
      (The sysfs_remove_file_from_group() call in .remove() (ahci_remove_one())
      does not help, as .remove() is not called on .probe() error.)
      
      Thus, if probe() fails after the sysfs_add_file_to_group() call, the next
      time we insmod the module we will get:
      
      sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:04.0/remapped_nvme'
      CPU: 11 PID: 954 Comm: modprobe Not tainted 6.10.0-rc5 #43
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0x5d/0x80
       sysfs_warn_dup.cold+0x17/0x23
       sysfs_add_file_mode_ns+0x11a/0x130
       sysfs_add_file_to_group+0x7e/0xc0
       ahci_init_one+0x31f/0xd40 [ahci]
      
      Fixes: 894fba7f ("ata: ahci: Add sysfs attribute to show remapped NVMe device count")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Link: https://lore.kernel.org/r/20240629124210.181537-10-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      eeb25a09
    • Niklas Cassel's avatar
      ata: libata-core: Fix double free on error · ab9e0c52
      Niklas Cassel authored
      If e.g. the ata_port_alloc() call in ata_host_alloc() fails, we will jump
      to the err_out label, which will call devres_release_group().
      devres_release_group() will trigger a call to ata_host_release().
      ata_host_release() calls kfree(host), so executing the kfree(host) in
      ata_host_alloc() will lead to a double free:
      
      kernel BUG at mm/slub.c:553!
      Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 11 PID: 599 Comm: (udev-worker) Not tainted 6.10.0-rc5 #47
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
      RIP: 0010:kfree+0x2cf/0x2f0
      Code: 5d 41 5e 41 5f 5d e9 80 d6 ff ff 4d 89 f1 41 b8 01 00 00 00 48 89 d9 48 89 da
      RSP: 0018:ffffc90000f377f0 EFLAGS: 00010246
      RAX: ffff888112b1f2c0 RBX: ffff888112b1f2c0 RCX: ffff888112b1f320
      RDX: 000000000000400b RSI: ffffffffc02c9de5 RDI: ffff888112b1f2c0
      RBP: ffffc90000f37830 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffc90000f37610 R11: 617461203a736b6e R12: ffffea00044ac780
      R13: ffff888100046400 R14: ffffffffc02c9de5 R15: 0000000000000006
      FS:  00007f2f1cabe980(0000) GS:ffff88813b380000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f2f1c3acf75 CR3: 0000000111724000 CR4: 0000000000750ef0
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? __die_body.cold+0x19/0x27
       ? die+0x2e/0x50
       ? do_trap+0xca/0x110
       ? do_error_trap+0x6a/0x90
       ? kfree+0x2cf/0x2f0
       ? exc_invalid_op+0x50/0x70
       ? kfree+0x2cf/0x2f0
       ? asm_exc_invalid_op+0x1a/0x20
       ? ata_host_alloc+0xf5/0x120 [libata]
       ? ata_host_alloc+0xf5/0x120 [libata]
       ? kfree+0x2cf/0x2f0
       ata_host_alloc+0xf5/0x120 [libata]
       ata_host_alloc_pinfo+0x14/0xa0 [libata]
       ahci_init_one+0x6c9/0xd20 [ahci]
      
      Ensure that we will not call kfree(host) twice, by performing the kfree()
      only if the devres_open_group() call failed.
      
      Fixes: dafd6c49 ("libata: ensure host is free'd on error exit paths")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Link: https://lore.kernel.org/r/20240629124210.181537-9-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      ab9e0c52
    • Niklas Cassel's avatar
      ata,scsi: libata-core: Do not leak memory for ata_port struct members · f6549f53
      Niklas Cassel authored
      libsas is currently not freeing all the struct ata_port struct members,
      e.g. ncq_sense_buf for a driver supporting Command Duration Limits (CDL).
      
      Add a function, ata_port_free(), that is used to free a ata_port,
      including its struct members. It makes sense to keep the code related to
      freeing a ata_port in its own function, which will also free all the
      struct members of struct ata_port.
      
      Fixes: 18bd7718 ("scsi: ata: libata: Handle completion of CDL commands using policy 0xD")
      Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
      Link: https://lore.kernel.org/r/20240629124210.181537-8-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      f6549f53
    • Niklas Cassel's avatar
      ata: libata-core: Fix null pointer dereference on error · 5d92c7c5
      Niklas Cassel authored
      If the ata_port_alloc() call in ata_host_alloc() fails,
      ata_host_release() will get called.
      
      However, the code in ata_host_release() tries to free ata_port struct
      members unconditionally, which can lead to the following:
      
      BUG: unable to handle page fault for address: 0000000000003990
      PGD 0 P4D 0
      Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 10 PID: 594 Comm: (udev-worker) Not tainted 6.10.0-rc5 #44
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
      RIP: 0010:ata_host_release.cold+0x2f/0x6e [libata]
      Code: e4 4d 63 f4 44 89 e2 48 c7 c6 90 ad 32 c0 48 c7 c7 d0 70 33 c0 49 83 c6 0e 41
      RSP: 0018:ffffc90000ebb968 EFLAGS: 00010246
      RAX: 0000000000000041 RBX: ffff88810fb52e78 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff88813b3218c0 RDI: ffff88813b3218c0
      RBP: ffff88810fb52e40 R08: 0000000000000000 R09: 6c65725f74736f68
      R10: ffffc90000ebb738 R11: 73692033203a746e R12: 0000000000000004
      R13: 0000000000000000 R14: 0000000000000011 R15: 0000000000000006
      FS:  00007f6cc55b9980(0000) GS:ffff88813b300000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000003990 CR3: 00000001122a2000 CR4: 0000000000750ef0
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? __die_body.cold+0x19/0x27
       ? page_fault_oops+0x15a/0x2f0
       ? exc_page_fault+0x7e/0x180
       ? asm_exc_page_fault+0x26/0x30
       ? ata_host_release.cold+0x2f/0x6e [libata]
       ? ata_host_release.cold+0x2f/0x6e [libata]
       release_nodes+0x35/0xb0
       devres_release_group+0x113/0x140
       ata_host_alloc+0xed/0x120 [libata]
       ata_host_alloc_pinfo+0x14/0xa0 [libata]
       ahci_init_one+0x6c9/0xd20 [ahci]
      
      Do not access ata_port struct members unconditionally.
      
      Fixes: 633273a3 ("libata-pmp: hook PMP support and enable it")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
      Link: https://lore.kernel.org/r/20240629124210.181537-7-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      5d92c7c5
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.10-3' of... · e0b668b0
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Remove the executable bit from installed DTB files
      
       - Escape $ in subshell execution in the debian-orig target
      
       - Fix RPM builds with CONFIG_MODULES=n
      
       - Fix xconfig with the O= option
      
       - Fix scripts_gdb with the O= option
      
      * tag 'kbuild-fixes-v6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: scripts/gdb: bring the "abspath" back
        kbuild: Use $(obj)/%.cc to fix host C++ module builds
        kbuild: rpm-pkg: fix build error with CONFIG_MODULES=n
        kbuild: Fix build target deb-pkg: ln: failed to create hard link
        kbuild: doc: Update default INSTALL_MOD_DIR from extra to updates
        kbuild: Install dtb files as 0644 in Makefile.dtbinst
      e0b668b0
    • Linus Torvalds's avatar
      x86-32: fix cmpxchg8b_emu build error with clang · 76932725
      Linus Torvalds authored
      The kernel test robot reported that clang no longer compiles the 32-bit
      x86 kernel in some configurations due to commit 95ece481
      ("locking/atomic/x86: Rewrite x86_32 arch_atomic64_{,fetch}_{and,or,xor}()
      functions").
      
      The build fails with
      
        arch/x86/include/asm/cmpxchg_32.h:149:9: error: inline assembly requires more registers than available
      
      and the reason seems to be that not only does the cmpxchg8b instruction
      need four fixed registers (EDX:EAX and ECX:EBX), with the emulation
      fallback the inline asm also wants a fifth fixed register for the
      address (it uses %esi for that, but that's just a software convention
      with cmpxchg8b_emu).
      
      Avoiding using another pointer input to the asm (and just forcing it to
      use the "0(%esi)" addressing that we end up requiring for the sw
      fallback) seems to fix the issue.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202406230912.F6XFIyA6-lkp@intel.com/
      Fixes: 95ece481 ("locking/atomic/x86: Rewrite x86_32 arch_atomic64_{,fetch}_{and,or,xor}() functions")
      Link: https://lore.kernel.org/all/202406230912.F6XFIyA6-lkp@intel.com/Suggested-by: default avatarUros Bizjak <ubizjak@gmail.com>
      Reviewed-and-Tested-by: default avatarUros Bizjak <ubizjak@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      76932725
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 84dd4373
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small driver fixes for 6.10-rc6. Included in here are:
      
         - IIO driver fixes for reported issues
      
         - Counter driver fix for a reported problem.
      
        All of these have been in linux-next this week with no reported
        issues"
      
      * tag 'char-misc-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        counter: ti-eqep: enable clock at probe
        iio: chemical: bme680: Fix sensor data read operation
        iio: chemical: bme680: Fix overflows in compensate() functions
        iio: chemical: bme680: Fix calibration data variable
        iio: chemical: bme680: Fix pressure value output
        iio: humidity: hdc3020: fix hysteresis representation
        iio: dac: fix ad9739a random config compile error
        iio: accel: fxls8962af: select IIO_BUFFER & IIO_KFIFO_BUF
        iio: adc: ad7266: Fix variable checking bug
        iio: xilinx-ams: Don't include ams_ctrl_channels in scan_mask
      84dd4373