summaryrefslogtreecommitdiff
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2022-08-25 09:31:21 -0400
committerIlya Dryomov <idryomov@gmail.com>2023-08-24 11:24:36 +0200
commit33a5f1709a44efa7253b84832fe4a49fccf4924b (patch)
tree15b5fb35136dfc20e625313fbf2c8e06335cdf1a /fs/ceph/addr.c
parentb294fa295ff47a1fdf4db5e8c9275cc7af328c5e (diff)
downloadlwn-33a5f1709a44efa7253b84832fe4a49fccf4924b.tar.gz
lwn-33a5f1709a44efa7253b84832fe4a49fccf4924b.zip
ceph: add read/modify/write to ceph_sync_write
When doing a synchronous write on an encrypted inode, we have no guarantee that the caller is writing crypto block-aligned data. When that happens, we must do a read/modify/write cycle. First, expand the range to cover complete blocks. If we had to change the original pos or length, issue a read to fill the first and/or last pages, and fetch the version of the object from the result. We then copy data into the pages as usual, encrypt the result and issue a write prefixed by an assertion that the version hasn't changed. If it has changed then we restart the whole thing again. If there is no object at that position in the file (-ENOENT), we prefix the write on an exclusive create of the object instead. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/addr.c')
0 files changed, 0 insertions, 0 deletions