Commit graph

2322 commits

Author SHA1 Message Date
Warner Losh db0a4f2d7a openzfs: unbreak 32-bit builds.
32-bit builds are broken. fix that by using PRIu64 instead of a
bare '%lu.'

Feel free to revert when upstream has this fixed. I'm agnostic as to the
proper fix, but don't have the time to fight upstreaming this on top of
everything else.
2023-11-29 08:26:29 -07:00
Martin Matuska 2276e53940 zfs: merge openzfs/zfs@688514e47
Notable upstream pull request merges:
 #15532 c1a47de86 zdb: Fix zdb '-O|-r' options with -e/exported zpool
 #15535 cf3316633 ZVOL: Minor code cleanup
 #15541 803a9c12c brt: lift internal definitions into _impl header
 #15541 213d68296 zdb: show BRT statistics and dump its contents
 #15543 a49087510 ZIL: Refactor TX_WRITE encryption similar to
                  TX_CLONE_RANGE
 #15543 27d8c23c5 ZIL: Do not encrypt block pointers in lr_clone_range_t
 #15549 67894a597 unnecessary alloc/free in dsl_scan_visitbp()
 #15551 126efb588 FreeBSD: Fix the build on FreeBSD 12
 #15563 acb33ee1c FreeBSD: Fix ZFS so that snapshots under .zfs/snapshot are
                  NFS visible
 #15564 7bbd42ef4 Don't allow attach to a raidz child vdev
 #15566 688514e47 dmu_buf_will_clone: fix race in transition back to NOFILL
 #15571 30d581121 dnode_is_dirty: check dnode and its data for dirtiness

Obtained from:	OpenZFS
OpenZFS commit:	688514e470
2023-11-28 21:35:58 +01:00
Konstantin Belousov c5405d1c85 vn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range()
Reviewed by:	markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42603
2023-11-28 19:32:53 +02:00
Brooks Davis 3faba3002f x86emu: remove localy added __FBSDID
This partially reverts 0a2e9846fd.

Reviewed by:	imp, delphij
Differential Revision:	https://reviews.freebsd.org/D42705
2023-11-27 16:47:41 +00:00
Martin Matuska a2b560cc69 zfs: merge openzfs/zfs@a94860a6d
Notable upstream pull request merges:
 #15511 92dc4ad83 Consider `dnode_t` allocations in dbuf cache size accounting
 #15514 22c8c33a5 Use abd_zero_off() where applicable
 #15515 5a3bffab1 ZIO: Optimize zio_flush()
 #15527 cd67bc0ae freebsd: remove __FBSDID macro use

Obtained from:	OpenZFS
OpenZFS commit: a94860a6de
2023-11-21 01:46:00 +01:00
Martin Matuska 47bb16f8f0 zfs: merge openzfs/zfs@03e9caaec
Notable upstream pull request merges:
 #15516 da51bd17e Fix snap_obj_array memory leak in check_filesystem()
 #15519 35da34516 L2ARC: Restrict write size to 1/4 of the device
 #15529 03e9caaec Add a tunable to disable BRT support

Obtained from:	OpenZFS
OpenZFS commit:	03e9caaec0
2023-11-17 09:39:42 +01:00
Martin Matuska e716630d4c zfs: merge openzfs/zfs@887a3c533
Notable upstream pull request merges:
 #15022 5caeef02f RAID-Z expansion feature
 #15457 887a3c533 Increase L2ARC write rate and headroom
 #15504 1c1be60fa Unbreak FreeBSD world build after 3bd4df384

Obtained from:	OpenZFS
OpenZFS commit:	887a3c533b
2023-11-09 13:19:17 +01:00
Martin Matuska 14c2e0a0c5 zfs: merge openzfs/zfs@9198de8f1
Notable upstream pull request merges:
 #15197 3bd4df384 Improve ZFS objset sync parallelism
 #15455 020f6fd09 FreeBSD: Implement taskq_init_ent()
 #15476 3d86999c7 sa_lookup() ignores buffer size
 #15478 2a154b848 Fix accounting error for pending sync IO ops in
                  zpool iostat
 #15484 dc45a00ea Add kern.features.zfs
 #15486 e36ff84c3 Update the kstat dataset_name when renaming a zvol
 #15491 f4cd1bac7 Make abd_raidz_gen_iterate() pass an initialized
                  pointer to the callback
 #15495 58398cbd0 FreeBSD: Optimize large kstat outputs

Obtained from:	OpenZFS
OpenZFS commit:	9198de8f10
2023-11-08 09:17:55 +01:00
Martin Matuska f8b1db88b8 zfs: merge openzfs/zfs@41e55b476
Notable upstream pull request merges:
 #15366 c3773de1 ZIL: Cleanup sync and commit handling
 #15409 dbe839a9 zvol: Cleanup set property
 #15409 60387fac zvol: Implement zvol threading as a Property
 #15409 9ccdb8be zvol: fix delayed update to block device ro entry
 #15448 05a7348a RAIDZ: Use cache blocking during parity math
 #15452 514d661c Tune zio buffer caches and their alignments
 #15456 799e09f7 Unify arc_prune_async() code
 #15465 763ca47f Fix block cloning between unencrypted and encrypted
                 datasets

To make the module version better comparable, the module version number
now includes the commit count since last tag.

Obtained from:	OpenZFS
OpenZFS commit:	41e55b476b
2023-11-01 10:13:42 +01:00
Martin Matuska 6c1e79df8c zfs: merge openzfs/zfs@043c6ee3b
Notable upstream pull request merges:
 #15360 97a0b5be Add mutex_enter_interruptible() for interruptible sleeping
                 IOCTLs
 #15381 252f46be ZIL: Detect single-threaded workloads
 #15398 3afdc97d ZIO: Remove READY pipeline stage from root ZIOs
 #15428 e007908a ABD: Be more assertive in iterators
 #15436 07345ac2 Add prefetch property
 #15438 e9725abd Revert "Do not persist user/group/project quota zap objects
                 when unneeded"
 #15451 043c6ee3 Read prefetched buffers from L2ARC

Obtained from:	OpenZFS
OpenZFS commit:	043c6ee3b6
2023-10-30 21:42:11 +01:00
Martin Matuska 22b267e823 zfs: merge openzfs/zfs@797f55ef1
Notable upstream pull request merges:
 #14378 c0e58995e Large sync writes perform worse with slog
 #14721 797f55ef1 Do not persist user/group/project quota zap objects
                  when unneeded
 #15356 380c25f64 FreeBSD: Improve taskq wrapper
 #15390 4fbc52495 Remove lock from dsl_pool_need_dirty_delay()
 #15397 57b409856 Trust ARC_BUF_SHARED() more
 #15402 b29e98fa8 Properly pad struct tx_cpu to cache line
 #15405 ea30b5a9e Set spa_ccw_fail_time=0 when expanding a vdev
 #15416 b9384b949 FreeBSD: taskq: Remove unused declaration

Obtained from:	OpenZFS
OpenZFS commit:	797f55ef12
2023-10-22 18:26:16 +02:00
Martin Matuska 23cf27db2c zfs: merge openzfs/zfs@8a7407012
Notable upstream pull request merges:
 #15368 008baa091 FreeBSD: Reduce divergence from in-tree sources
 #15371 1b310dfb1 DMU: Do not pre-read holes during write
 #15395 8a7407012 Zpool can start allocating from metaslab before
                  TRIMs have completed

Obtained from:	OpenZFS
OpenZFS commit:	8a74070128
2023-10-13 09:45:15 +02:00
Martin Matuska 26103ccba8 zfs: enable block cloning by default
Discussed with:	markj
Reviewed by:	mav
Tested  by:	mm (FreeBSD test suite + OpenZFS test suite)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D41991
2023-10-11 00:43:35 +02:00
Bjoern A. Zeeb ad134f8ab7 iwlwifi: re-enable "Invalid TXQ id" logging
Various reports recently hit the "Invalid TXQ id" in iwlwifi again.
Unconditionally enable logging and add a note to report to a specific
PR in the log message for now.
Along with 018d93ece1 this will hopefully help us to understand what
is going on.

Sponsored by:	The FreeBSD Foundation
PR:	274382
2023-10-09 19:50:02 +00:00
Martin Matuska b2526e8bfe zfs: merge openzfs/zfs@66b81b349
Notable upstream pull request merges:
 #15290 54b1b1d89 import: require force when cachefile hostid doesn't
                  match on-disk
 #15319 342357cd9 Reduce number of metaslab preload taskq threads
 #15340 2a6c62109 ARC: Remove b_cv from struct l1arc_buf_hdr
 #15347 75a2eb7fa ARC: Drop different size headers for crypto
 #15350 96b9cf42e ARC: Remove b_bufcnt/b_ebufcnt from ARC headers
 #15353 66b81b349 ZIL: Reduce maximum size of WR_COPIED to 7.5K
 #15362 5b8688e62 zfsconcepts: add description of block cloning

Obtained from:	OpenZFS
OpenZFS commit:	66b81b3497
2023-10-08 09:43:15 +02:00
Bjoern A. Zeeb 4f3b2bba24 rtw88: Use RF_CFGCH instead of hard coded 0x18
While debugging some funky register reads of 0xaeaea from RF_CFGCH
resulting in "rtw880: [TXGAPK] unknown channel 234!!" more of these
reads came to my attention hidden by using the register index rather
than the defined value.  Make this more grep-able.

MFC after:	3 days
2023-10-05 14:30:58 +00:00
Martin Matuska f7f4bd06a8 zfs: merge openzfs/zfs@f795e90a1
Notable upstream pull request merges:
 #15322 4e16964e1 Add '-u' - nomount flag for zfs set
 #15331 fe4d055b3 Report ashift of L2ARC devices in zdb
 #15333 249d759ca Fix invalid pointer access in trace_dbuf.h
 #15339 f795e90a1 Add BTI landing pads to the AArch64 SHA2 assembly

Obtained from:	OpenZFS
OpenZFS commit:	f795e90a11
2023-10-04 14:08:42 +02:00
Martin Matuska f7a5903de2 zfs: merge openzfs/zfs@e13538856
Notable upstream pull request merges:
 #15308 5551dcd76 Don't allocate from new metaslabs
 #15312 ba769ea35 Fix ENOSPC for extended quota
 #15321 e13538856 Restrict short block cloning requests
 #15324 f9c39dc86 Tweak rebuild in-flight hard limit

Obtained from:	OpenZFS
OpenZFS commit:	e135388564
2023-09-30 01:41:51 +02:00
Martin Matuska abcdc1b9ae zfs: merge openzfs/zfs@2e2a46e0a
Notable upstream pull request merges:
 #15243 b53077a9e Add zfs_prepare_disk script for disk firmware install
 #15298 2e2a46e0a Invoke zdb by guid to avoid import errors
 #15301 e5d70f467 ZIL: Avoid dbuf_read() in ztest_get_data()

Obtained from:	OpenZFS
OpenZFS commit:	2e2a46e0a5
2023-09-24 23:58:34 +02:00
Bjoern A. Zeeb 0a22677bce iwlwifi: local namespace change for sysctl
In order for the FreeBSD-specific sysctl (which gives us a full list of
PCI device IDs/names/and firmware prefixes) to be in the proper namespace
add a LINUXKPI_PARAM_PREFIX definition to the file as well.

The sysctl can now be used as:
sysctl -n compat.linuxkpi.iwlwifi_pci_ids_name

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 22:09:00 +00:00
Bjoern A. Zeeb 027768a212 iwlwifi firmware: update up-to -83 / updated -77 for others
Firmware was obtained from linux-firmware at
dfa11466cf000120d1551146fd5bf78c44941eda.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-09-21 17:08:00 +00:00
Bjoern A. Zeeb 9af1bba44e iwlwifi: update driver from upstream
This is a combined versions of updates of the iwlwifi driver based
on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1).
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5).
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3).

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-09-21 17:07:50 +00:00
Martin Matuska cbfe997563 zfs: merge openzfs/zfs@4647353c8
Notable upstream pull request merges:
 #15240 bbac1d297 Update the behavior of mountpoint property
 #15240 c63aabaf1 Improve the handling of sharesmb,sharenfs properties
 #15248 741c215ba Fix l2arc_apply_transforms ztest crash
 #15274 ee720ad7b Retire z_nr_znodes
 #15278 90149552b ZIL: Fix potential race on flush deferring
 #15279 e923bcd16 Update the MOS directory on spa_upgrade_errlog()
 #15281 529bec7d7 zed: Allow autoreplace and fault LEDs for removed vdevs
 #15288 7228ba111 cmd: add 'help' subcommand to zpool and zfs
 #15297 4647353c8 status: report pool suspension state under
                  failmode=continue

Obtained from:	OpenZFS
OpenZFS commit:	4647353c8b
2023-09-21 11:27:28 +02:00
Mateusz Guzik 49874af3ec zfs: retire z_nr_znodes
It is not needed and is going away soon(tm), facilitating other changes.

See https://github.com/openzfs/zfs/pull/15274
2023-09-16 14:18:05 +00:00
Bjoern A. Zeeb ee7077f24f iwlwifi: fix a bug in iwl_ssid_exist()
Rather than always comparing a given SSID to the first SSID of the
IE list, compare it to the the iterator one.  That way duplicates can
be found.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Martin Matuska 3159b89b61 zfs: merge openzfs/zfs@0ee9b0239
Notable upstream pull request merges:
  #15251 Add more constraints for block cloning

Obtained from:	OpenZFS
OpenZFS commit:	0ee9b02390
2023-09-11 09:18:48 +02:00
Bjoern A. Zeeb 815b7436a7 iwlwifi/LinuxKPI: 802.11: update ieee80211_request_smps()
Update ieee80211_request_smps() to the new number of arguments in
LinuxKPI (which was already prepared) and update the one call in the
older iwlwifi driver version.
This will allow iwlwifi as-is now and rtw88 to compile in case someone
else wants to work on the latter in parallel to predominant efforts on
the former.

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-09-05 21:14:25 +00:00
Bjoern A. Zeeb 90aac0d83b rtw88: update driver from upstream
This is a combined version of updates of the rtw88 driver based
on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

This update follows other currently disconnected LinuxKPI based wireless
drivers to lift them all to a same version in case someone else wants to
work on this driver in parallel to predominant iwlwifi efforts.

MFC after:	20 days
2023-09-05 21:13:19 +00:00
Bjoern A. Zeeb cf94672363 rtw88/rtw89: remove local firmware.
Remove firmware from src/ in favor of the ports/packages and fwget(8).
This will allow us to shrink the size of src (and installed modules).
Update the rtw88 man page to reflect the change.

MFC after:	20 days
X-MFC:		will see about 14/13
2023-09-05 21:13:18 +00:00
Xin LI ef3a764bc5 MFV: zlib: examples: define functions as static ones. (PR #855)
MFC after:	3 days
2023-09-04 20:14:31 -07:00
Martin Matuska 2ad756a6bb zfs: merge openzfs/zfs@95f71c019
Notable upstream pull request merges:
  #15018 Increase limit of redaction list by using spill block
  #15161 Make zoned/jailed zfsprops(7) make more sense
  #15216 Relax error reporting in zpool import and zpool split
  #15218 Selectable block allocators
  #15227 ZIL: Tune some assertions
  #15228 ZIL: Revert zl_lock scope reduction
  #15233 ZIL: Change ZIOs issue order

Obtained from:	OpenZFS
OpenZFS commit:	95f71c019d
2023-09-02 12:33:26 +02:00
Eric Joyner e04c4b4a36
ice_ddp: Update to 1.3.35.0
This is intended to be used with the upcoming updated ice(4) version
1.38.16-k.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

MFC after:	3 days
Sponsored by:	Intel Corporation
2023-08-30 12:43:54 -07:00
Martin Matuska 315ee00fa9 zfs: merge openzfs/zfs@804414aad
Notable upstream pull request merges:
  #15024 Add missed DMU_PROJECTUSED_OBJECT prefetch
  #15029 Do not request data L1 buffers on scan prefetch
  #15036 FreeBSD: catch up to __FreeBSD_version 1400093
  #15039 Fix raw receive with different indirect block size
  #15047 FreeBSD: Fix build on stable/13 after 1302506
  #15049 Fix the ZFS checksum error histograms with larger record sizes
  #15052 Reduce bloat in ereport.fs.zfs.checksum events
  #15056 Avoid extra snprintf() in dsl_deadlist_merge()
  #15061 Ignore pool ashift property during vdev attachment
  #15063 Don't panic if setting vdev properties is unsupported for this vdev type
  #15067 spa_min_alloc should be GCD, not min
  #15071 Add explicit prefetches to bpobj_iterate()
  #15072 Adjust prefetch parameters
  #15076 Refactor dmu_prefetch()
  #15079 set autotrim default to 'off' everywhere
  #15080 ZIL: Fix config lock deadlock
  #15088 metaslab: tuneable to better control force ganging
  #15096 Avoid waiting in dmu_sync_late_arrival()
  #15097 BRT should return EOPNOTSUPP
  #15103 Remove zl_issuer_lock from zil_suspend()
  #15107 Remove fastwrite mechanism
  #15113 libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1
  #15122 ZIL: Second attempt to reduce scope of zl_issuer_lock
  #15129 zpool_vdev_remove() should handle EALREADY error return
  #15132 ZIL: Replay blocks without next block pointer
  #15148 zfs_clone_range should return descriptive error codes
  #15153 ZIL: Avoid dbuf_read() before dmu_sync()
  #15172 copy_file_range: fix fallback when source create on same txg
  #15180 Update outdated assertion from zio_write_compress

Obtained from:	OpenZFS
OpenZFS commit:	804414aad2
2023-08-26 23:51:42 +02:00
Bjoern A. Zeeb e2340276fc rtw89: update driver from upstream
This is a set of updates of the rtw89 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1).
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5).
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3).
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

MFC after:      20 days
2023-08-21 01:35:29 +00:00
Bjoern A. Zeeb cbb3ec2523 mt76: update driver from upstream
This is a set of updates of the mt76 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
  This adds support for mt7996 as well.
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

The current version of LinuxKPI lacks support for "page pool" which
needs enhancing and updating a decade or so old shortcut mapping
struct page directly to struct vm_page.

MFC after:	20 days
2023-08-21 01:34:03 +00:00
Bjoern A. Zeeb 5c1def83a4 ath12k: import driver from upstream
Import BSD-3-Clause-Clear ath12k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1)
with further updates based on
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4),
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working (as does ath11k).
There was interest by various people to enhance support further
for ath11k which will equally benefit ath12k.

Given the lack of full license texts on the files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:	core (jhb, 2023-05-11) [1]
MFC after:      20 days
2023-08-21 01:33:04 +00:00
Bjoern A. Zeeb 28348caeee ath11k: update driver from upstream
This is a set of updates of the ath11k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after:	20 days
2023-08-21 01:32:46 +00:00
Bjoern A. Zeeb 07724ba62b ath10k: update driver from upstream
This is a set of updates of the ath10k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after:	20 days
2023-08-21 01:32:10 +00:00
Bjoern A. Zeeb eb50aa680f ath1xk_common: update common athk files from upstream
Update ath1xk_common based on wireless-testing (wt-2023-05-11)
711dca0ca3d77414f8f346e564e9c8640147f40d (right after v6.4-rc1).

MFC after:	20 days
2023-08-21 01:31:57 +00:00
Bjoern A. Zeeb 734e82fe33 ath10k: specifically mark a debug workaround for an early firmware crash
During the last import a (debug) workaround to avoid an early firmware
crash was imported.  In order to remember and to separate it from
upstream sources put it under #ifdef

MFC after:	20 days
2023-08-21 01:30:50 +00:00
Xin LI 4717628ed8 MFV: zlib 1.3
Relnotes:	yes
MFC after:	2 weeks
2023-08-19 23:06:49 -07:00
Martin Matuska 28d2e3b5de zfs: cherry-pick fix from openzfs
Vendor PR:
  #15103 Remove zl_issuer_lock from zil_suspend()

Obtained from:	OpenZFS
OpenZFS commit:	2848de11e5

Note: full vendor imports will continue when stable/14 has been branched
2023-08-10 10:11:52 +02:00
Martin Matuska cd25b0f740 zfs: cherry-pick fix from openzfs
Vendor PR:
  #15080 ZIL: Fix config lock deadlock

Obtained from:	OpenZFS
OpenZFS commit:	2cb992a99c

Note: full vendor imports will continue when stable/14 has been branched
2023-08-10 09:56:53 +02:00
Marius Strobl 077ef5b445 ath(4): Remove MIPS SoC build glue and AR9130 from FreeBSD HAL
All of these are obsoleted by the general removal of MIPS support.

Actually, corresponding to the removed AH_SUPPORT_x, there is more
superfluous support sprinkled across the HAL source. However, that
code is left in place for now in order to ease a sync to NetBSD.

Reviewed by:	emaste (w/ man page fix)
Approved by:	adrian
Differential Revision:	https://reviews.freebsd.org/D41355
2023-08-09 17:44:46 +02:00
Emmanuel Vadot fac71e4e09 Import device-tree files from Linux 6.4
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:32:31 +02:00
Emmanuel Vadot cb7aa33ac6 Import device-tree files from Linux 6.3
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:30:56 +02:00
Emmanuel Vadot 8bab661a33 Import device-tree files from Linux 6.2
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:29:14 +02:00
Emmanuel Vadot 7ef62cebc2 Import device-tree files from Linux 6.1
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2023-08-09 15:27:37 +02:00
Yuri Pankov b36f469a15 zfs: set autotrim default to 'off'
As it turns out having autotrim default to 'on' on FreeBSD never really
worked due to mess with defines where userland and kernel module were
getting different default values (userland was defaulting to 'off',
module was thinking it's 'on').

PR:		264234
Reviewed by:	mav (zfs)
Differential Revision: https://reviews.freebsd.org/D41056
2023-07-18 11:20:11 +02:00
Jessica Clarke c63c4e694c Don't bother to check COMPAT_32BIT when __LP64__ is defined
Under COMPAT_32BIT we are compiling 32-bit code and so __LP64__ is not
defined, __ILP32__ is, and thus the check is completely redundant.

Reviewed by:	brooks, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D40917
2023-07-09 18:45:32 +01:00
Mateusz Guzik ba8cc6d727 vfs: use __enum_uint8 for vtype and vstate
This whacks hackery around only reading v_type once.

Bump __FreeBSD_version to 1400093
2023-07-05 15:06:30 +00:00
Martin Matuska 0a97523d46 zfs: merge openzfs/zfs@009d3288d
Notable upstream pull request merges:
  #14654 Pack our DDT ZAPs a bit denser
  #14979 Again fix race between zil_commit() and zil_suspend()
  #14985 Some ZIO micro-optimizations
  #15000 Fix remount when setting multiple properties
  #15004 ddt_addref: remove unnecessary phys fill when refcount is 0
  #15007 Do not report bytes skipped by scan as issued
  #15023 Enable tuning of ZVOL open timeout value

Obtained from:	OpenZFS
OpenZFS commit:	009d3288de
OpenZFS tag:	zfs-2.2.0-rc1
2023-07-01 15:24:26 +02:00
Yuri Pankov af2939f227 Revert "openzfs: use IN_BASE instead of IN_FREEBSD_BASE in spa.h"
Further testing (sadly, after committing) shows that I missed the fact
that IN_BASE is used as userland/kernel delimiter (and not just for
FreeBSD-specific code unlike the IN_FREEBSD_BASE).  Revert until I have
a full (and proper) fix.

This reverts commit d2a45e9e81.
2023-06-29 23:04:35 +02:00
Yuri Pankov d2a45e9e81 openzfs: use IN_BASE instead of IN_FREEBSD_BASE in spa.h
Consistently use IN_BASE to allow libzfs to get the same default
autotrim value as kernel does.

Note that this does not change the default value itself, rather
fixing the source of value and the value itself in e.g. zpool get
output if it was not set explicitly.  (And as a reminder, default
value of autotrim on FreeBSD is 'on', despite what zpoolprops(7)
says currently.)

PR:		264234
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40075
2023-06-29 22:14:18 +02:00
Martin Matuska 7b5e687355 zfs: merge openzfs/zfs@a9d6b0690
Notable upstream pull request merges:
  #14925 Another set of vdev queue optimizations
  #14964 Use big transactions for small recordsize writes
  #14999 ZIL: Fix another use-after-free

Obtained from:	OpenZFS
OpenZFS commit:	a9d6b0690b
2023-06-29 01:39:52 +02:00
Warner Losh 2d38d9839b openzfs: Remove broken symlinks
These symlinks are broken. They point to files that don't exist, and
rely on having them be built using a 'in-tree' build that FreeBSD
doesn't use. They also show up as errors on grep -r. Since they are
broken and can't possibly work, remove them for now since non-functional
symlinks matching an upstrem repo that can't work in our repo aren't
worth the error messages.

Though one could argue the whole debian directory should be removed, I
did the minimal change necessary. These can return when the fundamental
issue is fixed and the contrib/debian tree is useful on FreeBSD systems.
2023-06-27 11:15:20 -06:00
Martin Matuska f190c36b5d zfs: merge openzfs/zfs@8e8acabdc
Notable upstream pull request merges:
  #14987 Fix memory leak in zil_parse()

Obtained from:	OpenZFS
OpenZFS commit:	8e8acabdca
2023-06-25 10:32:42 +02:00
Martin Matuska b7198dcfc0 zfs: merge openzfs/zfs@10e36e176
Notable upstream pull request merges:
  #14948 Remove ARC/ZIO physdone callbacks
  #14963 Store the L2ARC device ashift in the vdev label
  #14970 Switch refcount tracking from lists to AVL-trees
  #14981 Shorten arcstat_quiescence sleep time

Obtained from:	OpenZFS
OpenZFS commit:	10e36e1761
2023-06-16 23:13:05 +02:00
Krzysztof Zdziarski 266b0663c5 qat: Add Intel® 4xxx Series VF driver support
Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series VF driver support.
- Device configurability via sysctls.
- UIO support for Intel® 4xxx Series devices.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39850
2023-06-12 13:44:01 -04:00
Martin Matuska 4e8d558c9d zfs: merge openzfs/zfs@feff9dfed
Notable upstream pull request merges:
  #14833 Update compatibility.d files
  #14841 ZIL: Reduce scope of per-dataset zl_issuer_lock
  #14863 zil: Add some more statistics
  #14866 btree: Implement faster binary search algorithm
  #14894 Fix inconsistent definition of zfs_scrub_error_blocks_per_txg
  #14892 Fix concurrent resilvers initiated at same time
  #14903 Fix NULL pointer dereference when doing concurrent 'send' operations
  #14910 ZIL: Allow to replay blocks of any size
  #14939 Fix the L2ARC write size calculating logic
  #14934 Introduce zfs_refcount_(add|remove)_few()
  #14946 Improve l2arc reporting in arc_summary
  #14953 Finally drop long disabled vdev cache
  #14954 Fix the L2ARC write size calculating logic (2)
  #14955 Use list_remove_head() where possible
  #14959 ZIL: Fix race introduced by f63811f072

Obtained from:	OpenZFS
OpenZFS commit:	feff9dfed3
2023-06-10 19:31:17 +02:00
John Baldwin 48f52d9179 zfs: Fix build on 32-bit platforms after most recent import.
unsigned long is not a uint64_t on 32-bit platforms.  The zfs.4
manpage documents this variable as a uint, and it is only compared
with other variables of type int, so uint_t makes more sense than
unsigned long.

(I also wasn't sure if ULONG would work as a ZFS_MODULE_PARAM type
on other OS's)
2023-05-25 07:11:38 -07:00
Martin Matuska c0a83fe074 zfs: merge openzfs/zfs@ad0a55461
Notable upstream pull request merges:
  #12355 Teach zpool scrub to scrub only blocks in error log
  #14811 Refine special_small_blocks property validation
  #14854 zil: Some micro-optimizations
  #14855 zil: Free lwb_buf after write completion
  #14860 Fixes for issues identified by recent Coverity defect reports
  #14861 Probe vdevs before marking removed
  #14873 Add the ability to uninitialize a zpool
  #14875 Hold db_mtx when updating db_state

Obtained from:	OpenZFS
OpenZFS commit:	ad0a554614
2023-05-23 11:51:52 +02:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Bjoern A. Zeeb dd4f32ae62 ath11k: import ath11k driver
Import BSD-3-Clause-Clear ath11k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working.
There was interest by various people to enhance support further.

We initially only plan to support PCI parts but it would be great
to further enhance qcom SoC support to run on several (cheap) APs.

The firmware is provided by port net/wifi-firmware-ath11k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:    core (jhb, 2023-05-11) [1]
MFC after:      2 months
2023-05-12 11:21:16 +00:00
Martin Matuska e639e0d27c zfs: merge openzfs/zfs@e61076683
Notable upstream pull request merges:
  #14744 Optimize check_filesystem() and process_error_log()
  #14773 Allow zhack label repair to restore detached devices
  #14794 zpool import -m also removing spare and cache when log device
         is missing
  #14805 Simplify and optimize random_int_between()
  #14813 Enable the head_errlog feature to remove errors
  #14816 Fix two abd_gang_add_gang() issues
  #14817 Verify block pointers before writing them out
  #14819 Add dmu_tx_hold_append() interface
  #14823 Remove single parent assertion from zio_nowait()
  #14824 Plug memory leak in zfsdev_state
  #14825 Block cloning dbuf fixes
  #14828 Remove duplicate code in l2arc_evict()
  #14837 Fixes in head_errlog feature with encryption
  #14839 Prevent panic during concurrent snapshot rollback and zvol read
  #14853 zil: Don't expect zio_shrink() to succeed

Obtained from:	OpenZFS
OpenZFS commit:	e610766838
2023-05-12 13:13:33 +02:00
Martin Matuska d411c1d696 zfs: merge openzfs/zfs@d96e29576
Notable upstream pull request merges:

  #11680 Add support for zpool user properties
  #14145 Storage device expansion "silently" fails on degraded vdev
  #14405 Create zap for root vdev
  #14659 Allow MMP to bypass waiting for other threads
  #14674 Miscellaneous FreBSD compilation bugfixes
  #14692 Fix some signedness issues in arc_evict()
  #14702 Fix typo in check_clones()
  #14715 module: small fixes for FreeBSD/aarch64
  #14716 Trim needless zeroes from checksum events
  #14719 vdev: expose zfs_vdev_max_ms_shift as a module parameter
  #14722 Fix "Detach spare vdev in case if resilvering does not happen"
  #14723 freebsd clone range fixes
  #14728 Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
  #14735 Fix in check_filesystem()
  #14739 Fix data corruption when cloning embedded blocks
  #14758 Fix VERIFY(!zil_replaying(zilog, tx)) panic
  #14761 Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
  #14774 FreeBSD .zfs fixups
  #14776 FreeBSD: make zfs_vfs_held() definition consistent with declaration
  #14779 powerpc64: Support ELFv2 asm on Big Endian
  #14788 FreeBSD: add missing vop_fplookup assignments
  #14789 PAM: support the authentication facility
  #14790 Revert "Fix data race between zil_commit() and zil_suspend()"
  #14795 Fix positive ABD size assertion in abd_verify()
  #14798 Mark TX_COMMIT transaction with TXG_NOTHROTTLE
  #14804 Correct ABD size for split block ZIOs
  #14806 Use correct block pointer in block cloning case.
  #14808 blake3: fix up bogus checksums in face of cpu migration

Obtained from:	OpenZFS
OpenZFS commit:	d96e29576c
2023-05-03 12:04:55 +02:00
Warner Losh b53ec4e44f stand: Add isspace to FreeBSD ctypes.h
And eliminate blake3_impl_hack.c since it's no longer needed.

Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D39899
2023-05-01 15:02:54 -06:00
Warner Losh 6c8358cd7f stand: back out the most of the horrible aarch64 kludge
Add one ifdef to upstrem code and get rid of compiling the horrible
checked-in aarch64 assembler for the boot loader that the loader will
never use. I'll attempt to upstream this and adjust as needed.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39897
2023-05-01 15:02:54 -06:00
Kyle Evans 087a2e64ba openzfs: re-enable FPU usage on aarch64
The BLAKE3 generated assembly files have now been updated to avoid
clobbering x18, we can safely re-enable FPU usage on aarch64.
2023-04-26 19:47:14 -05:00
Tino Reichardt 42f0ac5f1b Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
The x18 register isn't useable within FreeBSD kernel space, so we
have to fix the BLAKE3 aarch64 assembly for not using it.

The source files are here: https://github.com/mcmilk/BLAKE3-tests

Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #14728
2023-04-26 19:46:47 -05:00
Mateusz Guzik d09a955a60 zfs: Fix positive ABD size assertion in abd_verify().
This cherry-picks upstream:
commit bba7cbf0a4
Author: Alexander Motin <mav@FreeBSD.org>
Date:   Wed Apr 26 12:20:43 2023 -0400

    Fix positive ABD size assertion in abd_verify().

    Gang ABDs without childred are legal, and they do have zero size.
    For other ABD types zero size doesn't have much sense and likely
    not working correctly now.

    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by:  Alexander Motin <mav@FreeBSD.org>
    Sponsored by:   iXsystems, Inc.
    Closes #14795

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 18:00:36 +00:00
Kyle Evans ce5a210997 openzfs: arm64: implement kfpu_begin/kfpu_end
This is part one of a fix for booting with ZFS on arm64 using
accelerated checksum implementations.  Checksum benchmarking will
attempt to use the FPU, so we currently panic quickly on boot.  BLAKE3
is still broken, as it clobbers x18 and we promptly discover that fact
as soon as we attempt to fetch curthread in kfpu_end().

Note that _STANDALONE is special-cased here, but ideally we wouldn't be
building the code that uses kfpu_begin()/kfpu_end() at all in the loader
environment.

Discussed with:	imp (a bit)
Differential Revision:	https://reviews.freebsd.org/D39448
2023-04-26 12:24:00 -05:00
Justin Hibbits cfaab41c95 irdma: Convert to IfAPI
Mostly mechanical changes, with some reworking in irdma_cm for iterating
over interfaces and addresses.  Further rework by Bartosz Sobczak.

Reviewed by:	bartosz.sobczak_intel.com
Tested by:	mateusz.moga_intel.com
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38960
2023-04-25 14:25:31 -04:00
Dimitry Andric 64b5d74fff zfs: make zfs_vfs_held() definition consistent with declaration
Noticed while attempting to change boolean_t into an actual bool: in
include/sys/zfs_ioctl_impl.h, zfs_vfs_held() is declared to return a
boolean_t, but in module/os/freebsd/zfs/zfs_ioctl_os.c it is defined to
return an int. Make the definition match the declaration.

Obtained from:	https://github.com/openzfs/zfs/commit/62cc9d4f6
Reviewed by:	jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D39753
2023-04-25 19:58:17 +02:00
Mateusz Guzik b0695c6abe zfs: Revert "Fix data race between zil_commit() and zil_suspend()"
This reverts commit 4c856fb333.

To quote a pending upstream PR:
This reverts commit 4c856fb to resolve a newly introduced deadlock which
in practice is more disruptive that the issue this commit intended to
address.

Causes deadlocks described in https://github.com/openzfs/zfs/issues/14775

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-25 16:01:22 +00:00
Allan Jude c98ecfceb3 Add support for zpool user properties
Usage:

    zpool set org.freebsd:comment="this is my pool" poolname

Tests are based on zfs_set's user property tests.

Also stop truncating property values at MAXNAMELEN, use ZFS_MAXPROPLEN.

Reviewed by:	markj
Approved by:	markj
Co-authored-by:	Mateusz Piotrowski <0mp@FreeBSD.org>
Obtained from:	OpenZFS 8eae2d214c Add support for zpool user properties
Sponsored by:	Beckhoff Automation GmbH & Co. KG.
Sponsored by:	Klara Inc.
Differential Revision: https://reviews.freebsd.org/D39657
2023-04-25 17:23:07 +02:00
Mateusz Guzik b4d3dd8615 zfs: fix up bogus checksums with blake3 in face of cpu migration
This is a temporary measure until a better fix is sorted out.

Upstream report: https://github.com/openzfs/zfs/issues/14785
Reported by:	Evgeniy Khramtsov
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-25 15:20:19 +00:00
John Baldwin 9b02f2daf4 powerpc: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39733
2023-04-24 08:53:50 -07:00
Bjoern A. Zeeb da8fa4e37a ath10k: import ath10k driver
Import ISC-licensed ath10k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Import support to redirect fwlogs to kernel messages
from https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/389075

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Any other native driver using BUS_PROBE_DEFAULT will attach
ignoring this one by default given bsd_probe_return is set
to a lower priority.

Add the module build framework.

We only support PCI parts.

The firmware is provided by port net/wifi-firmware-ath10k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core (emaste, 2022-04-08) [1]
MFC after:	2 months
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb ebacd8013f athk: import common code for ath1?k drivers
Import common ISC-licensed athk parts assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

The only modification should be for FreeBSD module
handling in main.c.

Add the module build framework unconnected to the
build for now.

These files will be shared by ath1?k drivers.

MFC after:	2 months
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb 6c92544d7c mt76: import mediatek/mt76 driver
Import ISC-licensed driver parts of mediatek/mt76
assumed to be based on Linux wireless-testing at
a02411a5b98612c12be99349836d99f07db12a77 (tag: wt-2022-11-23).

Complement the driver and LinuxKPI with our own (dummy)
implementations of missing parts (util.h and soc/mediatek/)
as well as changes to make compile on FreeBSD with changes
covered by #ifdef (__FreeBSD__) conditions.
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

For the moment we only target the mt7915 and mt7921 PCI parts.
More may follow in the future.

Firmware is provided by port net/wifi-firmware-mt76-kmod.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core (emaste, 2022-04-08) [1]
MFC after:	2 months
2023-04-23 21:29:49 +00:00
Justin Hibbits 0468e89cb3 zfs/powerpc64: Fix big-endian powerpc64 asm
The powerpc asm from openzfs assumes that big-endian is always ELFv1 and
ELFv2 is always little-endian, while FreeBSD uses ELFv2 everywhere.  Add
the necessary bits to the checksum asm to work on big-endian ELFv2.

This was also submitted upstream as PR#14779.

Tested by:	dbaio
2023-04-22 11:27:49 -04:00
Bjoern A. Zeeb 7db7bfe1a7 iwlwifi: quieten more compiler warnings
Quieten some more (valid) gcc warnings and disable dead code.
There are more warnings, some probably a compiler problem, the
other related to firmware structs which I do not want to adjust
just locally.  Leave a comment to revisit after a next driver
update.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-20 16:07:05 +00:00
Mateusz Guzik 9c4e270822 zfs: fix up EINVAL from getdirentries on .zfs
PR:	270909
2023-04-20 08:38:28 +00:00
Mateusz Guzik 7ff3143809 zfs: add missing vn state transition for .zfs
Reported by:	des
2023-04-20 08:09:59 +00:00
Bjoern A. Zeeb f621b087c0 iwlwifi: rtw88: rtw89: fix gcc warnings
Fix -Wno-format and unused variables warnings with gcc by adopting
(to|the) FreeBSD-specific code.

Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D39673
2023-04-19 12:21:40 +00:00
Pawel Jakub Dawidek 068913e4ba zfs: Add vfs.zfs.bclone_enabled sysctl.
Keep block cloning disabled by default for now, but allow to enable and
use it after setting vfs.zfs.bclone_enabled to 1, so people can easily
try it.

Approved by:	oshogbo
Reviewed by:	mm, oshogbo
Differential Revision:	https://reviews.freebsd.org/D39613
2023-04-17 03:38:30 -07:00
Pawel Jakub Dawidek 1959e122d9 zfs: Merge https://github.com/openzfs/zfs/pull/14739
The zfs_log_clone_range() function is never called from the
zfs_clone_range_replay() function, so I assumed it is safe to assert
that zil_replaying() is never TRUE here. It turns out zil_replaying()
also returns TRUE when the sync property is set to disabled.

Fix the problem by just returning if zil_replaying() returns TRUE.

Reported by: Florian Smeets
Signed-off-by: Pawel Jakub Dawidek pawel@dawidek.net

Approved by: oshogbo, mm
2023-04-17 02:22:56 -07:00
Pawel Jakub Dawidek e0bb199925 zfs: cherry-pick openzfs/zfs@c71fe7164
Fix data corruption when cloning embedded blocks

Don't overwrite blk_phys_birth, as for embedded blocks it is part of
the payload.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Issue #13392
Closes #14739

Approved by: oshogbo, mm
2023-04-17 02:19:49 -07:00
Mateusz Guzik 63ee747feb zfs: Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
This reverts commit 519851122b.

It results in data corruption, see:
https://github.com/openzfs/zfs/issues/14753

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-15 21:34:54 +00:00
Mateusz Guzik 46ac8f2e7d zfs: don't use zfs_freebsd_copy_file_range
There is one data corruption problem reported and fixed upstream, not
cherry-picked here yet.

On top of it the following fires under load:
        VERIFY(zil_replaying(zfsvfs->z_log, tx));

The patch which introduced the entire machinery is a revert candidate,
but as the machinery came with a dedicated feature flag, doing so would
render affected pools read-only at best. To be figured out.

As a temporary bandaid at least stop the active usage.
Note this patch does not make the feature disappear from zpool upgrade.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-15 21:34:54 +00:00
John Baldwin 8e9db62e74 zfs: Appease set by unused warnings for spl_fstrans_*mark stubs.
Use a void cast to mark the cookie value as used in spl_fstrans_unmark.

Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39357
2023-04-10 10:36:14 -07:00
Konstantin Belousov 182b21d462 openzfs: adopt to the new vn_lock_pair() interface
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-04-08 02:37:56 +03:00
Mateusz Guzik d6e2490134 zfs: disable kernel fpu usage on arm and aarc64
It is not implemented and causes panics on boot.

This is a temporary measure until someone(tm) sorts it out.

Reported by:	many
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 21:44:49 +00:00
Mateusz Guzik 20be1b4fc4 zfs: try to fallback early if can't do optimized copy
Not complete, but already shaves on some locking.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 15:47:45 +00:00
Mateusz Guzik d012836fb6 zfs: fix up EXDEV handling for clone_range
API contract requires VOPs to handle EXDEV internally, worst case by
falling back to the generic copy routine. This broke with the recent
changes.

While here whack custom loop to lock 2 vnodes with vn_lock_pair, which
provides the same functionality internally. write start/finish around
it plays no role so got eliminated.

One difference is that vn_lock_pair always takes an exclusive lock on
both vnodes. I did not patch around it because current code takes an
exclusive lock on the target vnode. zfs supports shared-locking for
writes, so this serializes different calls to the routine as is, despite
range locking inside. At the same time you may notice the source vnode
can get some traffic if only shared-locked, thus once more this goes
the safer route of exclusive-locking. Note this should be patched to
use shared-locking for both once the feature is considered stable.

Technically the switch to vn_lock_pair should be a separate change, but
it would only introduce churn immediately whacked by the rest of the
patch.

[note: technically the review is still in progress, but so is the
active breakage]

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 15:46:20 +00:00
Mateusz Guzik e2d997d1cb zfs: add missing vop_fplookup_vexec assignments
This happens to be a nop right now.
2023-04-06 15:20:40 +00:00
Martin Matuska eb1feadc20 zfs: fix null ap->a_fsizetd NULL pointer derefernce
Submitted by:		rmacklem
Reported by:		cy
Tested by:		cy, mm
Reviewed by:		pjd, mm
Differential revision:	https://reviews.freebsd.org/D39418
2023-04-05 09:33:32 +02:00
Martin Matuska 91ef6f14f2 Revert "zfs: fall back if block_cloning feature is disabled"
This reverts commit 8ee579abe0.
2023-04-04 16:34:34 +02:00
Martin Matuska 8ee579abe0 zfs: fall back if block_cloning feature is disabled
If block_cloning is disabled, or other errors from zfs_clone_range()
return an EXDEV we should fall back to vn_generic_copy_file_range().

This fixes issues when copying files on the same dataset with
block_cloning disabled.

Upstreamed as pull request to OpenZFS.

Reviewed by:	Mateusz Guzik <mjguzik@gmail.com>
OpenZFS pull request:	14713
2023-04-04 13:43:34 +02:00