Skip to content
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

NAS-133555 / None / Block remap for cloned blocks on device removal #287

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions module/zfs/metaslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

#include <sys/zfs_context.h>
#include <sys/brt.h>
#include <sys/dmu.h>
#include <sys/dmu_tx.h>
#include <sys/space_map.h>
Expand Down Expand Up @@ -5551,6 +5552,13 @@ spa_remap_blkptr(spa_t *spa, blkptr_t *bp, spa_remap_cb_t callback, void *arg)
if (BP_GET_NDVAS(bp) < 1)
return (B_FALSE);

/*
* Cloned blocks can not be remapped since BRT depends on specific
* vdev id and offset in the DVA[0] for its reference counting.
*/
if (!BP_IS_METADATA(bp) && brt_maybe_exists(spa, bp))
return (B_FALSE);

/*
* Note: we only remap dva[0]. If we remapped other dvas, we
* would no longer know what their phys birth txg is.
Expand Down
Loading