]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
fsync set policy ioctls
authorMarcel Lauhoff <marcel.lauhoff@suse.com>
Fri, 12 Aug 2022 12:45:29 +0000 (14:45 +0200)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 23 Aug 2022 16:35:43 +0000 (09:35 -0700)
commit75cf58070a87aecfdad295ee50d048603d1916ed
tree8a5a21f76b18938075a0d35b73e25b2f00a7b502
parenta1ddf6e09af39320fee969f52d36ae0f2ca94d83
fsync set policy ioctls

Split policyIoctl into setPolicyIoctl and getPolicyIoctl. Add a
os.Sync() call to setPolicyIoctl.

Policy ioctls are not necessary durable on return. For example, on
ext4 (ref: fs/ext4/crypto.c: ext4_set_context) they are not. This may
lead to a filesystem containing fscrypt metadata (in .fscrypt), but
without the policy applied on an encrypted directory.

Example:
Snapshotting a mounted ext4 filesystem on Ceph RBD right after
setting the policy. While subject to timing, with high probability the
snapshot will not have the policy set. Calling fsync fixes this.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
metadata/policy.go
metadata/policy_test.go