ceph: clamp length of a read to CEPH_MSG_MAX_DATA_LEN
Subsystems (2)
PATCH 1/1 ceph: clamp length of a read to CEPH_MSG_MAX_DATA_LEN
There's a hard limit on how large a read we can do from the OSD, defined as CEPH_MSG_MAX_DATA_LEN (currently, 64M). It's possible to create a file that is backed by larger objects than that (and indeed, xfstest ceph/001 does just that).
Ensure we clamp the final length of a read to CEPH_MSG_MAX_DATA_LEN.
Signed-off-by Jeff Layton <[email protected]>
--- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I'm likely going to fold this patch into the one that introduces ceph_netfs_issue_op, so we don't have a regression in the series.
fs/ceph/addr.c +1 -1
@@ -212,7 +212,7 @@ static bool ceph_netfs_clamp_length(struct netfs_read_subrequest *subreq)/* Truncate the extent at the end of the current block */ ceph_calc_file_object_mapping (&ci->i_layout, subreq->start, subreq->len, &objno, &objoff, &xlen); - subreq->len = xlen; + subreq->len =min (xlen, (u32 )CEPH_MSG_MAX_DATA_LEN );return true; }
Signature · 1 line
2.31.1