]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Use correct sizes in write_success
authorChristopher Hoffman <choffman@redhat.com>
Thu, 27 Feb 2025 19:11:40 +0000 (19:11 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:35 +0000 (13:59 +0000)
Write success had some incorrect usage of sizes.
request_[size|offset] refers to logical size
toalwritten + offset refers to written to osd size

Fixes: https://tracker.ceph.com/issues/70193
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc

index 1a6353a8eba3a6ac19f71267a9ef8f1412fcaa49..c5fb556fb36df56a55404e4d7b04f980025de100 100644 (file)
@@ -12146,14 +12146,12 @@ int64_t Client::_write_success(Fh *f, utime_t start, uint64_t fpos,
 
   // extend file?
   if (request_size + request_offset > in->effective_size()) {
-    size = request_size + request_offset;
     if (encrypted) {
-      in->set_effective_size(size);
+      in->set_effective_size(request_size + request_offset);
       in->mark_caps_dirty(CEPH_CAP_FILE_EXCL);
-      size = fscrypt_next_block_start(offset + size);
     }
     ldout(cct, 7) << "in->effective_size()=" << in->effective_size() << dendl;
-    in->size = size;
+    in->size = totalwritten + offset;
     in->mark_caps_dirty(CEPH_CAP_FILE_WR);
 
     if (is_quota_bytes_approaching(in, f->actor_perms)) {