]> git.hungrycats.org Git - linux/commitdiff
btrfs: zstd: pass fs_info to btrfs_warn() on failure to allocate workspace manager
authorFilipe Manana <fdmanana@suse.com>
Wed, 28 Oct 2026 15:37:59 +0000 (15:37 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:19 +0000 (21:36 +0100)
The workspace manager is per filesystem and we have access to the fs_info
structure of the filesystem in zstd_alloc_workspace_manager(), so pass it
to the btrfs_warn() call so that we get a better log message (including
the device, state, etc).

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zstd.c

index 9b7c7f43527f7fa8590fa52f940b0ad55485f22f..b686f67d52ec148ec6f8ba810a35deaceb001c42 100644 (file)
@@ -200,7 +200,7 @@ int zstd_alloc_workspace_manager(struct btrfs_fs_info *fs_info)
 
        ws = zstd_alloc_workspace(fs_info, ZSTD_BTRFS_MAX_LEVEL);
        if (IS_ERR(ws)) {
-               btrfs_warn(NULL, "cannot preallocate zstd compression workspace");
+               btrfs_warn(fs_info, "cannot preallocate zstd compression workspace");
        } else {
                set_bit(ZSTD_BTRFS_MAX_LEVEL - 1, &zwsm->active_map);
                list_add(ws, &zwsm->idle_ws[ZSTD_BTRFS_MAX_LEVEL - 1]);