mirror of
https://github.com/ceph/ceph
synced 2024-12-18 17:37:38 +00:00
Merge pull request #18400 from dillaman/wip-21844
osdc/Objecter: skip sparse-read result decode if bufferlist is empty Reviewed-by: Greg Farnum <gfarnum@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
7c387fd04a
@ -335,13 +335,20 @@ struct ObjectOperation {
|
||||
void finish(int r) override {
|
||||
bufferlist::iterator iter = bl.begin();
|
||||
if (r >= 0) {
|
||||
try {
|
||||
::decode(*extents, iter);
|
||||
::decode(*data_bl, iter);
|
||||
} catch (buffer::error& e) {
|
||||
if (prval)
|
||||
*prval = -EIO;
|
||||
}
|
||||
// NOTE: it's possible the sub-op has not been executed but the result
|
||||
// code remains zeroed. Avoid the costly exception handling on a
|
||||
// potential IO path.
|
||||
if (bl.length() > 0) {
|
||||
try {
|
||||
::decode(*extents, iter);
|
||||
::decode(*data_bl, iter);
|
||||
} catch (buffer::error& e) {
|
||||
if (prval)
|
||||
*prval = -EIO;
|
||||
}
|
||||
} else if (prval) {
|
||||
*prval = -EIO;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user