-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zfs-2.1.13 patchset #15268
zfs-2.1.13 patchset #15268
Commits on Jun 9, 2023
-
zfs-dkms rpm: simplify scriptlets, fix uninstall
Two problems led to unexpected behaviour of the scriptlets: 1) Newer DKMS versions change the formatting of "dkms status": (old) zfs, 2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed (new) zfs/2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed Which broke a conditional determining whether to uninstall. 2) zfs_config.h not packaged properly, but was attempted to be read in the %preun scriptlet: CONFIG_H="/var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h" Which broke the uninstallation of the module, which left behind a dangling symlink, which broke DKMS entirely with this error: Error! Could not locate dkms.conf file. File: /var/lib/dkms/zfs/2.1.1/source/dkms.conf does not exist. This change attempts to simplify life by: * Avoiding parsing anything (less prone to future breakage) * Uses %posttrans instead of %post for module installation, because %post happens before %preun, while %posttrans happens afterwards * Unconditionally reinstall module on upgrade, which is less efficient but the trade-off is that it's more reliable Alternative approaches could involve fixing the existing parsing bugs or improving the logic, but this comes at the cost of complexity and possible future bugs. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jeremy Visser <[email protected]> Closes openzfs#10463 Closes openzfs#13182
Configuration menu - View commit details
-
Copy full SHA for c5bbd80 - Browse repository at this point
Copy the full SHA c5bbd80View commit details
Commits on Jun 13, 2023
-
tests: zts-report: issue numbers are numbers
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#13259
Configuration menu - View commit details
-
Copy full SHA for 6af79c9 - Browse repository at this point
Copy the full SHA 6af79c9View commit details
Commits on Jun 18, 2023
-
contrib/bash_completion.d: fix error spew from __zfs_match_snapshot()
Given: /sbin/zfs list filling/a-zvol<TAB> -o space,refratio The rest of the cmdline gets vored by: /sbin/zfs list filling/a-zvolcannot open 'filling/a-zvol': operation not applicable to datasets of this type With -x (fragment): + COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur")) +++ __zfs_match_snapshot +++ local base_dataset=filling/dziadtop-nowe-duchy +++ [[ filling/dziadtop-nowe-duchy != filling/dziadtop-nowe-duchy ]] +++ [[ filling/dziadtop-nowe-duchy != '' ]] +++ __zfs_list_datasets filling/dziadtop-nowe-duchy +++ /sbin/zfs list -H -o name -s name -t filesystem -r filling/dziadtop-nowe-duchy +++ tail -n +2 cannot open 'filling/dziadtop-nowe-duchy': operation not applicable to datasets of this type +++ echo filling/dziadtop-nowe-duchy +++ echo filling/dziadtop-nowe-duchy@ ++ compgen -W 'filling/dziadtop-nowe-duchy This properly completes with: $ /sbin/zfs list filling/a-zvol<TAB> -o space,refratio filling/a-zvol filling/a-zvol@ $ /sbin/zfs list filling/a-zvol<cursor> -o space,refratio Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Backport-of: 5ece420 Closes openzfs#12820
Configuration menu - View commit details
-
Copy full SHA for f9a2d94 - Browse repository at this point
Copy the full SHA f9a2d94View commit details
Commits on Jun 26, 2023
-
Fix memory leak in zil_parse().
482da24 missed arc_buf_destroy() calls on log parse errors, possibly leaking up to 128KB of memory per dataset during ZIL replay. Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc.
Configuration menu - View commit details
-
Copy full SHA for cb549c7 - Browse repository at this point
Copy the full SHA cb549c7View commit details -
Remove duplicate code in l2arc_evict()
l2arc_evict() performs the adjustment of the size of buffers to be written on L2ARC unnecessarily. l2arc_write_size() is called right before l2arc_evict() and performs those adjustments. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes openzfs#14828
Configuration menu - View commit details
-
Copy full SHA for d91778e - Browse repository at this point
Copy the full SHA d91778eView commit details -
Fix the L2ARC write size calculating logic
l2arc_write_size() should return the write size after adjusting for trim and overhead of the L2ARC log blocks. Also take into account the allocated size of log blocks when deciding when to stop writing buffers to L2ARC. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes openzfs#14939
Configuration menu - View commit details
-
Copy full SHA for 425f789 - Browse repository at this point
Copy the full SHA 425f789View commit details -
Fix the L2ARC write size calculating logic (2)
While commit bcd5321 adjusts the write size based on the size of the log block, this happens after comparing the unadjusted write size to the evicted (target) size. In this case l2ad_hand will exceed l2ad_evict and violate an assertion at the end of l2arc_write_buffers(). Fix this by adding the max log block size to the allocated size of the buffer to be committed before comparing the result to the target size. Also reset the l2arc_trim_ahead ZFS module variable when the adjusted write size exceeds the size of the L2ARC device. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes openzfs#14936 Closes openzfs#14954
Configuration menu - View commit details
-
Copy full SHA for c12b582 - Browse repository at this point
Copy the full SHA c12b582View commit details -
Store the L2ARC device ashift in the vdev label
If this is not done, and the pool has an ashift other than the default (at the moment 9) then the following happens: 1) vdev_alloc() assigns the ashift of the pool to L2ARC device, but upon export it is not stored anywhere 2) at the first import, vdev_open() sees an vdev_ashift() of 0 and assigns the logical_ashift, which is 9 3) reading the contents of L2ARC, including the header fails 4) L2ARC buffers are not restored in ARC. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes openzfs#14313 Closes openzfs#14963
Configuration menu - View commit details
-
Copy full SHA for f28cd34 - Browse repository at this point
Copy the full SHA f28cd34View commit details -
Shorten arcstat_quiescence sleep time
With the latest L2ARC fixes, 2 seconds is too long to wait for quiescence of arcstats like l2_size. Shorten this interval to avoid having the persistent L2ARC tests in ZTS prematurely terminated. Signed-off-by: George Amanakis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ef2156c - Browse repository at this point
Copy the full SHA ef2156cView commit details
Commits on Jul 13, 2023
-
Fix remount when setting multiple properties.
The previous code was checking zfs_is_namespace_prop() only for the last property on the list. If one was not "namespace", then remount wasn't called. To fix that move zfs_is_namespace_prop() inside the loop and remount if at least one of properties was "namespace". Reviewed-by: Umer Saleem <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes openzfs#15000
Configuration menu - View commit details
-
Copy full SHA for 6e79bcd - Browse repository at this point
Copy the full SHA 6e79bcdView commit details
Commits on Jul 20, 2023
-
Fix raw receive with different indirect block size.
Unlike regular receive, raw receive require destination to have the same block structure as the source. In case of dnode reclaim this triggers two special cases, requiring special handling: - If dn_nlevels == 1, we can change the ibs, but dnode_set_blksz() should not dirty the data buffer if block size does not change, or durign receive dbuf_dirty_lightweight() will trigger assertion. - If dn_nlevels > 1, we just can't change the ibs, dnode_set_blksz() would fail and receive_object would trigger assertion, so we should destroy and recreate the dnode from scratch. Reviewed-by: Paul Dagnelie <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes openzfs#15039
Configuration menu - View commit details
-
Copy full SHA for e01e3a4 - Browse repository at this point
Copy the full SHA e01e3a4View commit details
Commits on Jul 24, 2023
-
zed: Fix zed ASSERT on slot power cycle
We would see zed assert on one of our systems if we powered off a slot. Further examination showed zfs_retire_recv() was reporting a GUID of 0, which in turn would return a NULL nvlist. Add in a check for a zero GUID. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes openzfs#15084
Configuration menu - View commit details
-
Copy full SHA for 846a4cc - Browse repository at this point
Copy the full SHA 846a4ccView commit details
Commits on Jul 26, 2023
-
zed: Reduce log noise for large JBODs
For large JBODs the log message "zfs_iter_vdev: no match" can account for the bulk of the log messages (over 70%). Since this message is purely informational and not that useful we remove it. Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#15086 Closes openzfs#15094
Configuration menu - View commit details
-
Copy full SHA for 1abf68b - Browse repository at this point
Copy the full SHA 1abf68bView commit details
Commits on Aug 2, 2023
-
Update the META file to reflect compatibility with the 6.4 kernel. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Lahfa <[email protected]> Closes openzfs#15125
Configuration menu - View commit details
-
Copy full SHA for 245850b - Browse repository at this point
Copy the full SHA 245850bView commit details
Commits on Aug 25, 2023
-
Workaround issue cleaning up automounted snapshots on Linux
On Linux, sometimes, when ZFS goes to unmount an automounted snap, it fails a VERIFY check on debug builds, because taskq_cancel_id returned ENOENT after not finding the taskq it was trying to cancel. This presumably happens when it already died for some reason; in this case, we don't really mind it already being dead, since we're just going to dispatch a new task to unmount it right after. So we just ignore it if we get back ENOENT trying to cancel here, retry a couple times if we get back the only other possible condition (EBUSY), and log to dbgmsg if we got anything but ENOENT or success. (We also add some locking around taskqid, to avoid one or two cases of two instances of trying to cancel something at once.) Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes openzfs#11632 Closes openzfs#12670
Configuration menu - View commit details
-
Copy full SHA for 692f780 - Browse repository at this point
Copy the full SHA 692f780View commit details -
quick fix for lingering snapdir unmount problems
Unfortunately, even after e79b680, I still, much more rarely, tripped asserts when playing with many ctldir mounts at once. Since this appears to happen if we dispatched twice too fast, just ignore it. We don't actually need to do anything if someone already started doing it for us. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes openzfs#14462
Configuration menu - View commit details
-
Copy full SHA for 426d07d - Browse repository at this point
Copy the full SHA 426d07dView commit details
Commits on Sep 11, 2023
-
Linux: Never sleep in kmem_cache_alloc(..., KM_NOSLEEP) (openzfs#14926)
When a kmem cache is exhausted and needs to be expanded a new slab is allocated. KM_SLEEP callers can block and wait for the allocation, but KM_NOSLEEP callers were incorrectly allowed to block as well. Resolve this by attempting an emergency allocation as a best effort. This may fail but that's fine since any KM_NOSLEEP consumer is required to handle an allocation failure. Signed-off-by: Brian Behlendorf <[email protected]> Reviewed-by: Adam Moss <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 837e426 - Browse repository at this point
Copy the full SHA 837e426View commit details -
Linux 6.5 compat: BLK_STS_NEXUS renamed to BLK_STS_RESV_CONFLICT
This change was introduced in Linux commit 7ba150834b840f6f5cdd07ca69a4ccf39df59a66 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15059
Configuration menu - View commit details
-
Copy full SHA for f52d9b6 - Browse repository at this point
Copy the full SHA f52d9b6View commit details -
Linux 6.5 compat: disk_check_media_change() was added
The disk_check_media_change() function was added which replaces bdev_check_media_change. This change was introduced in 6.5rc1 444aa2c58cb3b6cfe3b7cc7db6c294d73393a894 and the new function takes a gendisk* as its argument, no longer a block_device*. Thus, bdev->bd_disk is now used to pass the expected data. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15060
Configuration menu - View commit details
-
Copy full SHA for e45ca51 - Browse repository at this point
Copy the full SHA e45ca51View commit details -
Linux 6.5 compat: register_sysctl_table removed
Additionally, the .child element of ctl_table has been removed in 6.5. This change adds a new test for the pre-6.5 register_sysctl_table() function, and uses the old code in that case. If it isn't found, then the parentage entries in the tables are removed, and the register_sysctl call is provided the paths of "kernel/spl", "kernel/spl/kmem", and "kernel/spl/kstat" directly, to populate each subdirectory over three calls, as is the new API. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15098
Configuration menu - View commit details
-
Copy full SHA for 211868b - Browse repository at this point
Copy the full SHA 211868bView commit details -
Linux 6.5 compat: use disk_check_media_change when it exists
When disk_check_media_change() exists, then define zfs_check_media_change() to simply call disk_check_media_change() on the bd_disk member of its argument. Since disk_check_media_change() is newer than when revalidate_disk was present in bops, we should be able to safely do this via a macro, instead of recreating a new implementation of the inline function that forces revalidation. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15101
Configuration menu - View commit details
-
Copy full SHA for 3ff9e4f - Browse repository at this point
Copy the full SHA 3ff9e4fView commit details -
Linux 6.5 compat: blkdev changes
Multiple changes to the blkdev API were introduced in Linux 6.5. This includes passing (void* holder) to blkdev_put, adding a new blk_holder_ops* arg to blkdev_get_by_path, adding a new blk_mode_t type that replaces uses of fmode_t, and removing an argument from the release handler on block_device_operations that we weren't using. The open function definition has also changed to take gendisk* and blk_mode_t, so update it accordingly, too. Implement local wrappers for blkdev_get_by_path() and vdev_blkdev_put() so that the in-line calls are cleaner, and place the conditionally-compiled implementation details inside of both of these local wrappers. Both calls are exclusively used within vdev_disk.c, at this time. Add blk_mode_is_open_write() to test FMODE_WRITE / BLK_OPEN_WRITE The wrapper function is now used for testing using the appropriate method for the kernel, whether the open mode is writable or not. Emphasize fmode_t arg in zvol_release is not used Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15099
Configuration menu - View commit details
-
Copy full SHA for 7c0618b - Browse repository at this point
Copy the full SHA 7c0618bView commit details -
Linux 6.4 compat: iter_iov() function now used to get old iov member
The iov_iter->iov member is now iov_iter->__iov and must be accessed via the accessor function iter_iov(). Create a wrapper that is conditionally compiled to use the access method appropriate for the target kernel version. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15100
Configuration menu - View commit details
-
Copy full SHA for feb0fa6 - Browse repository at this point
Copy the full SHA feb0fa6View commit details -
Linux 4.20 compat: wrapper function for iov_iter type access
An iov_iter_type() function to access the "type" member of the struct iov_iter was added at one point. Move the conditional logic to decide which method to use for accessing it into a macro and simplify the zpl_uio_init code. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15100
Configuration menu - View commit details
-
Copy full SHA for 5ee79af - Browse repository at this point
Copy the full SHA 5ee79afView commit details -
Revert "Linux 6.5 compat: register_sysctl_table removed"
This reverts commit b35374f as there are error messages when loading the SPL module. Errors seemed to be tied to duplicate a duplicate entry. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#15134
Configuration menu - View commit details
-
Copy full SHA for 0ee7a08 - Browse repository at this point
Copy the full SHA 0ee7a08View commit details -
Linux 6.5 compat: register_sysctl_table removed
Additionally, the .child element of ctl_table has been removed in 6.5. This change adds a new test for the pre-6.5 register_sysctl_table() function, and uses the old code in that case. If it isn't found, then the parentage entries in the tables are removed, and the register_sysctl call is provided the paths of "kernel/spl", "kernel/spl/kmem", and "kernel/spl/kstat" directly, to populate each subdirectory over three calls, as is the new API. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15138
Configuration menu - View commit details
-
Copy full SHA for cb115ed - Browse repository at this point
Copy the full SHA cb115edView commit details -
Linux 6.5 compat: replace generic_file_splice_read with filemap_splic…
…e_read The generic_file_splice_read function was removed in Linux 6.5 in favor of filemap_splice_read. Add an autoconf test for filemap_splice_read and use it if it is found as the handler for .splice_read in the file_operations struct. Additionally, ITER_PIPE was removed in 6.5. This change removes the ITER_* macros that OpenZFS doesn't use from being tested in config/kernel-vfs-iov_iter.m4. The removal of ITER_PIPE was causing the test to fail, which also affected the code responsible for setting the .splice_read handler, above. That behavior caused run-time panics on Linux 6.5. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15155
Configuration menu - View commit details
-
Copy full SHA for 9b7f7f0 - Browse repository at this point
Copy the full SHA 9b7f7f0View commit details -
Linux 6.5 compat: Use copy_splice_read instead of filemap_splice_read
Using the filemap_splice_read function for the splice_read handler was leading to occasional data corruption under certain circumstances. Favor using copy_splice_read instead, which does not demonstrate the same erroneous behavior under the tested failure cases. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15164
Configuration menu - View commit details
-
Copy full SHA for c74a17a - Browse repository at this point
Copy the full SHA c74a17aView commit details -
Linux 6.5 compat: safe cleanup in spl_proc_fini()
If we fail to create a proc entry in spl_proc_init() we may end up calling unregister_sysctl_table() twice: one in the failure path of spl_proc_init() and another time during spl_proc_fini(). Avoid the double call to unregister_sysctl_table() and while at it refactor the code a bit to reduce code duplication. This was accidentally introduced when the spl code was updated for Linux 6.5 compatibility. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Signed-off-by: Andrea Righi <[email protected]> Closes openzfs#15234 Closes openzfs#15235
Configuration menu - View commit details
-
Copy full SHA for cb28c0b - Browse repository at this point
Copy the full SHA cb28c0bView commit details -
Linux 6.5 compat: spl: properly unregister sysctl entries
When register_sysctl_table() is unavailable we fail to properly unregister sysctl entries under "kernel/spl". This leads to errors like the following when spl is unloaded/reloaded, making impossible to properly reload the spl module: [ 746.995704] sysctl duplicate entry: /kernel/spl/kmem/slab_kvmem_total Fix by cleaning up all the sub-entries inside "kernel/spl" when the spl module is unloaded. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Andrea Righi <[email protected]> Closes openzfs#15239
Configuration menu - View commit details
-
Copy full SHA for adf428c - Browse repository at this point
Copy the full SHA adf428cView commit details -
intptr_t definition is canonically signed
Make the version here match that elsewhere in the kernel and system headers. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes openzfs#15058
Configuration menu - View commit details
-
Copy full SHA for 92fc218 - Browse repository at this point
Copy the full SHA 92fc218View commit details
Commits on Sep 12, 2023
-
zed: Add zedlet to power off slot when drive is faulted
If ZED_POWER_OFF_ENCLOUSRE_SLOT_ON_FAULT is enabled in zed.rc, then power off the drive's slot in the enclosure if it becomes FAULTED. This can help silence misbehaving drives. This assumes your drive enclosure fully supports slot power control via sysfs. Reviewed-by: @AllKind Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes openzfs#15200
Configuration menu - View commit details
-
Copy full SHA for a4f82db - Browse repository at this point
Copy the full SHA a4f82dbView commit details -
zed: update zed.d/statechange-slot_off.sh
The statechange-slot_off.sh zedlet which was added in openzfs#15200 needed to be installed so it's included by the packages. Additional testing has also shown that multiple retries are often needed for the script to operate reliably. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#15210
Configuration menu - View commit details
-
Copy full SHA for a449d8b - Browse repository at this point
Copy the full SHA a449d8bView commit details -
checkstyle: fix action failures
Reviewed-by: Don Brady <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes openzfs#15220
Configuration menu - View commit details
-
Copy full SHA for c8a3c74 - Browse repository at this point
Copy the full SHA c8a3c74View commit details -
Linux 6.5 compat: META (openzfs#15265)
Update the META file to reflect compatibility with the 6.5 kernel. Signed-off-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ae0d644 - Browse repository at this point
Copy the full SHA ae0d644View commit details
Commits on Sep 20, 2023
-
Cleanup: Replace oldstyle struct hack with C99 flexible array members
The Linux 5.16.14 kernel's coccicheck caught this. The semantic patch that caught it was: ./scripts/coccinelle/misc/flexible_array.cocci However, unlike the cases where the GNU zero length array extension had been used, coccicheck would not suggest patches for the older style single member arrays. That was good because blindly changing them would break size calculations in most cases. Therefore, this required care to make sure that we did not break size calculations. In the case of `indirect_split_t`, we use `offsetof(indirect_split_t, is_child[is->is_children])` to calculate size. This might be subtly wrong according to an old mailing list thread: https://inbox.sourceware.org/gcc-prs/[email protected]/T/ That is because the C99 specification should consider the flexible array members to start at the end of a structure, but compilers prefer to put padding at the end. A suggestion was made to allow compilers to allocate padding after the VLA like compilers already did: http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n983.htm However, upon thinking about it, whether or not we allocate end of structure padding does not matter, so using offsetof() to calculate the size of the structure is fine, so long as we do not mix it with sizeof() on structures with no array members. In the case that we mix them and padding causes offsetof(struct_t, vla_member[0]) to differ from sizeof(struct_t), we would be doing unsafe operations if we underallocate via `offsetof()` and then overcopy via sizeof(). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes openzfs#14372
Configuration menu - View commit details
-
Copy full SHA for a93c30a - Browse repository at this point
Copy the full SHA a93c30aView commit details -
check-zstd-symbols: also ignore __pfx_ symbols
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b341b20d648bb7e9a3307c33163e7399f0913e66 Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#15282 Closes openzfs#15284
Configuration menu - View commit details
-
Copy full SHA for a3169da - Browse repository at this point
Copy the full SHA a3169daView commit details
Commits on Sep 21, 2023
-
META file and changelog updated. Signed-off-by: Tony Hutter <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eb62221 - Browse repository at this point
Copy the full SHA eb62221View commit details