osd: return -EPERM on insufficient caps

Send a failure to the client instead of dropping the request on the floor.

Fixes: #3066
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-09-21 17:38:24 -07:00
parent 3b4f754a18
commit a73777a902

View File

@ -1583,8 +1583,10 @@ void PG::do_request(OpRequestRef op)
{ {
// do any pending flush // do any pending flush
do_pending_flush(); do_pending_flush();
if (!op_has_sufficient_caps(op)) if (!op_has_sufficient_caps(op)) {
osd->reply_op_error(op, -EPERM);
return; return;
}
if (must_delay_request(op)) { if (must_delay_request(op)) {
waiting_for_map.push_back(op); waiting_for_map.push_back(op);
return; return;