]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: fix REFLINK_P_MAY_UPDATE_OPTIONS
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 24 May 2025 05:56:10 +0000 (01:56 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 25 May 2025 07:22:18 +0000 (03:22 -0400)
If we're doing a reflink copy of existing reflinked data, we may only
set REFLINK_P_MAY_UPDATE_OPTIONS if it was set on the reflink pointer
we're copying from.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/reflink.c

index 3a13dbcab6bab057cbe3b8197dd34c195657565e..41ca86cba2cd056e490dfda85933d09f44c672c4 100644 (file)
@@ -711,7 +711,8 @@ s64 bch2_remap_range(struct bch_fs *c,
                        SET_REFLINK_P_IDX(&dst_p->v, offset);
 
                        if (reflink_p_may_update_opts_field &&
-                           may_change_src_io_path_opts)
+                           may_change_src_io_path_opts &&
+                           REFLINK_P_MAY_UPDATE_OPTIONS(src_p.v))
                                SET_REFLINK_P_MAY_UPDATE_OPTIONS(&dst_p->v, true);
                } else {
                        BUG();