mirror of
https://github.com/ceph/ceph
synced 2025-03-06 08:20:12 +00:00
Merge pull request #9856 from hzhang-wx/master
librbd: discard should return error if length too large Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
commit
89eb5635b5
@ -1160,6 +1160,10 @@ namespace librbd {
|
||||
{
|
||||
ImageCtx *ictx = (ImageCtx *)ctx;
|
||||
tracepoint(librbd, discard_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len);
|
||||
if (len > std::numeric_limits<int32_t>::max()) {
|
||||
tracepoint(librbd, discard_exit, -EINVAL);
|
||||
return -EINVAL;
|
||||
}
|
||||
int r = ictx->aio_work_queue->discard(ofs, len);
|
||||
tracepoint(librbd, discard_exit, r);
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user