[PATCH 5/6] nvme: also return I/O command effects from nvme_command_effects

Christoph Hellwig hch at lst.de
Tue Dec 27 08:57:54 PST 2022


On Sun, Dec 25, 2022 at 12:26:35PM +0200, Sagi Grimberg wrote:
>> +		if (ns->head->ids.csi == NVME_CAP_CSS_NVM)
>> +			effects |= nvme_known_nvm_effects(opcode);
>>   		if (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))
>>   			dev_warn_once(ctrl->device,
>> -				"IO command:%02x has unhandled effects:%08x\n",
>> +				"IO command:%02x has unusual effects:%08x\n",
>>   				opcode, effects);
>> -		return 0;
>> -	}
>>   -	if (ctrl->effects)
>> -		effects = le32_to_cpu(ctrl->effects->acs[opcode]);
>> -	effects |= nvme_known_admin_effects(opcode);
>> +		/*
>> +		 * NVME_CMD_EFFECTS_CSE_MASK causes a freeze all I/O queues,
>> +		 * which would deadlock when done on an I/O command.  Note that
>> +		 * We already warn about an unusual effect above.
>> +		 */
>
> I think it would be helpful to warn that we are masking it out? The
> warning above does not directly relate to the cse mask, but rather anthing 
> outside of NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC ?

Well, all these effects are unusual for I/O commands, and all the
effects really are hints to the host.  But if you think we can do
better, can you send an incremental fixup?  We'll need to get
these fixes in ASAP to fix the gapping security hole, or just
revert the unprivileged passthrough for 6.2.



More information about the Linux-nvme mailing list