Skip to content

Commit

Permalink
Linux 5.16: Resolve ZSTD_isError symbol collision in Linux kernel
Browse files Browse the repository at this point in the history
Newer zstd code introduced in the main kernel tree now creates a symbol
collision with ZSTD_isError in our ZSTD code. This change relabels our
implementation with a ZFS-specific symbol name, and undoes some
macro-based micro-optimizations that conflict with the attempt to rename
our internal-use version.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #12819
  • Loading branch information
ckane authored and tonyhutter committed Dec 7, 2021
1 parent 6a3ba75 commit 2a21853
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions module/zstd/include/zstd_compat_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@
zfs_ZSTD_insertAndFindFirstIndex_internal
#define ZSTD_insertBlock zfs_ZSTD_insertBlock
#define ZSTD_invalidateRepCodes zfs_ZSTD_invalidateRepCodes
#define ZSTD_isError zfs_ZSTD_isError
#define ZSTD_isFrame zfs_ZSTD_isFrame
#define ZSTD_ldm_adjustParameters zfs_ZSTD_ldm_adjustParameters
#define ZSTD_ldm_blockCompress zfs_ZSTD_ldm_blockCompress
Expand Down
2 changes: 0 additions & 2 deletions module/zstd/lib/zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6340,7 +6340,6 @@ extern "C" {

/* ---- static assert (debug) --- */
#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
#define ZSTD_isError ERR_isError /* for inlining */
#define FSE_isError ERR_isError
#define HUF_isError ERR_isError

Expand Down Expand Up @@ -7347,7 +7346,6 @@ const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
/*-****************************************
* ZSTD Error Management
******************************************/
#undef ZSTD_isError /* defined within zstd_internal.h */
/*! ZSTD_isError() :
* tells if a return value is an error code
* symbol is required for external callers */
Expand Down

0 comments on commit 2a21853

Please sign in to comment.