]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: bcachefs_metadata_version_reflink_p_may_update_opts
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 7 Nov 2024 04:16:24 +0000 (23:16 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 29 Dec 2024 18:30:39 +0000 (13:30 -0500)
commitea4f9e75ecfb1203980716d6306de3f8789a049e
treee8308a3b6546295af5f9c91b5576ce9fc8ada88a
parenta36d8f0e0e3d427ffafae30694587efffda16f7c
bcachefs: bcachefs_metadata_version_reflink_p_may_update_opts

Previously, io path option changes on a file would be picked up
automatically and applied to existing data - but not for reflinked data,
as we had no way of doing this safely. A user may have had permission to
copy (and reflink) a given file, but not write to it, and if so they
shouldn't be allowed to change e.g. nr_replicas or other options.

This uses the incompat feature mechanism in the previous patch to add a
new incompatible flag to bch_reflink_p, indicating whether a given
reflink pointer may propagate io path option changes back to the
indirect extent.

In this initial patch we're only setting it for the source extents.

We'd like to set it for the destination in a reflink copy, when the user
has write access to the source, but that requires mnt_idmap which is not
curretly plumbed up to remap_file_range.

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