Actions
Tasks #69797
closedTasks #63293: Implement fscrypt in libcephfs and cephfs-fuse
Tasks #69796: general libcephfs unit tests fail
OpenReadWrite
% Done:
0%
Reviewed:
Affected Versions:
Component(FS):
Labels (FS):
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:
Description
[ RUN ] LibCephFS.OpenReadWrite
/cephfs/ceph/src/test/libcephfs/test.cc:151: Failure
Expected equality of these values:
ceph_read(cmount, fd, in_buf, sizeof(in_buf), 0)
Which is: 100
(int)size
Which is: 11
[ FAILED ] LibCephFS.OpenReadWrite (1898 ms)
Updated by Christopher Hoffman about 1 year ago
- Status changed from New to In Progress
- Assignee set to Christopher Hoffman
Updated by Christopher Hoffman about 1 year ago
- Status changed from In Progress to Resolved
Author: Christopher Hoffman <choffman@redhat.com>
Date: Tue Feb 4 18:31:28 2025 +0000
client: Calculate len before prepare_data_read
Fixes: https://tracker.ceph.com/issues/69797
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
diff --git a/src/client/Client.cc b/src/client/Client.cc
index aa33b766779..af8feef7d1f 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -11486,6 +11486,11 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
uint64_t read_start;
uint64_t read_len;
+ auto effective_size = in->effective_size();
+ if (off + len > effective_size) {
+ len = effective_size - off;
+ }
+
FSCryptFDataDencRef fscrypt_denc;
fscrypt->prepare_data_read(in->fscrypt_ctx,
&in->fscrypt_key_validator,
@@ -11496,7 +11501,6 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
// get Fc cap ref before commencing read
get_cap_ref(in, CEPH_CAP_FILE_CACHE);
- auto effective_size = in->effective_size();
if (onfinish != nullptr) {
io_finish.reset(new C_Read_Async_Finisher(this, onfinish, f, in, bl,
f->pos, off, len,
@@ -11526,10 +11530,6 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
return 0;
}
- if (off + len > effective_size) {
- len = effective_size - off;
- }
-
auto target_len = std::min(len, effective_size - off);
ldout(cct, 10) << " min_bytes=" << f->readahead.get_min_readahead_size()
Actions