aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/lib/libzutil
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2026-05-13 19:53:01 +0000
committerColin Percival <cperciva@FreeBSD.org>2026-05-14 23:58:46 +0000
commit409247a6cbd11e3510025e025f3b82184c3de17c (patch)
tree49200e7c219ffc2bb10fec867bc55ded8cbe5686 /sys/contrib/openzfs/lib/libzutil
parent2ebec3c7ead5f5b477a5ab47136562777f2bb495 (diff)
zfs: merge openzfs/zfs@6330a45b0 (zfs-2.4-release) into stable/15
OpenZFS 2.4.2 Notable upstream pull request merges: #18208 6f14581e1 Cleanup allocation class selection #18235 7590972f7 Prevent range tree corruption race by updating dnode_sync() #18255 b06caaeec range_tree: use zfs_panic_recover() for partial-overlap remove #18258 33961142a Fix deadlock on dmu_tx_assign() from vdev_rebuild() #18262 02ed09106 Fix check for .cfi_negate_ra_state on aarch64 #18263 9f92266b7 Fix redundant declaration of dsl_pool_t #18276 3862aadf7 Fix vdev_rebuild_range() tx commit #18290 a94b137aa FreeBSD: Improve dmesg kernel message prefix #18294 938c8c98b draid: fix data corruption after disk clear #18310 b40cd9191 Fix s_active leak in zfsvfs_hold() when z_unmounted is true #18380 9b8ccbd2c draid: fix import failure after disks replacements #18399 4bb759274 Add support for POSIX_FADV_DONTNEED #18403 aba3ed30a fix memleak in spa_errlog.c #18405 e9a8c6e08 draid: allow seq resilver reads from degraded vdevs #18414 da44040bb draid: fix cksum errors after rebuild with degraded disks #18421 e7524594a Fix read corruption after block clone after truncate #18440 b8addf922 dmu_direct: avoid UAF in dmu_write_direct_done() #18473 76fd64ac9 Fix rare cksum errors after rebuild #18482 fc87e269e Initialize vr_last_txg for rebuild #18489 38501e182 Fix long POSIX_FADV_DONTNEED for single block files Approved by: re (cperciva) Obtained from: OpenZFS OpenZFS commit: 6330a45b06d20125de679aae5f63ba14082671ef OpenZFS tag: zfs-2.4.2 (cherry picked from commit a40f24ec28554c2387e766a47d2d4cb910d95865)
Diffstat (limited to 'sys/contrib/openzfs/lib/libzutil')
-rw-r--r--sys/contrib/openzfs/lib/libzutil/Makefile.am1
-rw-r--r--sys/contrib/openzfs/lib/libzutil/os/linux/zutil_device_path_os.c16
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/contrib/openzfs/lib/libzutil/Makefile.am b/sys/contrib/openzfs/lib/libzutil/Makefile.am
index 519906235f7f..5e085ec6c1f0 100644
--- a/sys/contrib/openzfs/lib/libzutil/Makefile.am
+++ b/sys/contrib/openzfs/lib/libzutil/Makefile.am
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: CDDL-1.0
libzutil_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
libzutil_la_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUDEV_CFLAGS)
libzutil_la_CFLAGS += -fvisibility=hidden
diff --git a/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_device_path_os.c b/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_device_path_os.c
index 8ed062bf9b37..64e05f52d95e 100644
--- a/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_device_path_os.c
+++ b/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_device_path_os.c
@@ -218,7 +218,8 @@ zfs_get_pci_slots_sys_path(const char *dev_name)
char *address2 = NULL;
char *path = NULL;
char buf[MAXPATHLEN];
- char *tmp;
+ const char *tmp;
+ char *tmp2;
/* If they preface 'dev' with a path (like "/dev") then strip it off */
tmp = strrchr(dev_name, '/');
@@ -240,9 +241,9 @@ zfs_get_pci_slots_sys_path(const char *dev_name)
* be "0000:01:00.0" while /sys/bus/pci/slots/0/address will be
* "0000:01:00". Just NULL terminate at the '.' so they match.
*/
- tmp = strrchr(address1, '.');
- if (tmp != NULL)
- *tmp = '\0';
+ tmp2 = strrchr(address1, '.');
+ if (tmp2 != NULL)
+ *tmp2 = '\0';
dp = opendir("/sys/bus/pci/slots/");
if (dp == NULL) {
@@ -311,6 +312,7 @@ zfs_get_enclosure_sysfs_path(const char *dev_name)
DIR *dp = NULL;
struct dirent *ep;
char buf[MAXPATHLEN];
+ const char *tmp0;
char *tmp1 = NULL;
char *tmp2 = NULL;
char *tmp3 = NULL;
@@ -322,9 +324,9 @@ zfs_get_enclosure_sysfs_path(const char *dev_name)
return (NULL);
/* If they preface 'dev' with a path (like "/dev") then strip it off */
- tmp1 = strrchr(dev_name, '/');
- if (tmp1 != NULL)
- dev_name = tmp1 + 1; /* +1 since we want the chr after '/' */
+ tmp0 = strrchr(dev_name, '/');
+ if (tmp0 != NULL)
+ dev_name = tmp0 + 1; /* +1 since we want the chr after '/' */
tmpsize = asprintf(&tmp1, "/sys/block/%s/device", dev_name);
if (tmpsize == -1 || tmp1 == NULL) {