If an object map update fails, the object map will be flagged as
invalid. However, if a subsequent update failure occurs, the error
code will propagate back to the caller.
Fixes: #11369
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit
99f5a7d595c653447b351898192410c9cb773770)
m_on_finish->complete(-ERESTART);
delete this;
} else if (should_complete(r)) {
- m_on_finish->complete(r);
+ m_on_finish->complete(filter_return_code(r));
delete this;
}
}
return true;
}
virtual bool should_complete(int r) = 0;
-
+ virtual int filter_return_code(int r) {
+ return r;
+ }
private:
bool m_canceled;
xlist<AsyncRequest *>::item m_xlist_item;
protected:
virtual bool should_complete(int r);
+ virtual int filter_return_code(int r) {
+ // never propagate an error back to the caller
+ return 0;
+ }
virtual void finish(ObjectMap *object_map) = 0;
private:
State m_state;
bool invalidate();
- };
+ };
class ResizeRequest : public Request {
public: