dCache / dcache

dCache - a system for storing and retrieving huge amounts of data, distributed among a large number of heterogenous server nodes, under a single virtual filesystem tree with a variety of standard access methods
https://dcache.org
276 stars 132 forks source link

pool: fix miscalculation of offset on short read. #7580

Closed kofemann closed 1 month ago

kofemann commented 1 month ago

Motivation: With CentOS7, the client sends the last request, such that offset+count == filesize. REHL9 sends the last request so that the count is multiple of 4096, which is legal.

CentOS7: Opcode: READ (25) StateID [StateID Hash: 0x96ef] StateID seqid: 1 StateID Other: 6651b9bd00040e8600000001 [StateID Other hash: 0x49a6ba9d] offset: 3785359360 count: 312015

RHEL9: Opcode: READ (25) stateid [StateID Hash: 0x065f] seqid: 0x00000001 Data: 66522f570001001100000001 offset: 3785359360 count: 315392

If the count was bigger than internal buffer size, so that we needed to use multiple reads, the second read offset was miscalculated, as the expectation was that offset+count equals filesize.

Modification:

Result: NFS mover used the correct value for next file offset and number of bytes.

Ticket: #10617, #10615 Acked-by: Paul Millar Target: master, 10.0, 9.2 Require-book: no Require-notes: yes (cherry picked from commit 0597b1f47a47738a023b5fc81fe2fec684f80926)