On 01/10/2014 04:37 PM, Olaf Hering wrote:
On Fri, Jan 10, Boris Ostrovsky wrote:
If the call below fails, is it safe to continue using discard feature? At
the least, are discard_granularity and discard_alignment guaranteed to have
sane/safe values?
Its up to the toolstack to provide sane values. In the worst case
discard fails. In this specific case the three values are optional, so
the calls can fail. I do not know what happens if the backend device
actually needs the values, but the frontend can not send proper discard
requests. Hopefully it will not damage the hardware..
I don't know discard code works but it seems to me that if you pass, for
example, zero as discard_granularity (which may happen if
xenbus_gather() fails) then blkdev_issue_discard() in the backend will
set granularity to 1 and continue with discard. This may not be what the
the guest admin requested. And he won't know about this since no error
message is printed anywhere.
Similarly, if xenbug_gather("discard-secure") fails, I think the code
will assume that secure discard has not been requested. I don't know
what security implications this will have but it sounds bad to me.
I think we should at clear feature_discard and print an error in the log
if *either* of xenbus_gather() calls fail.
-boris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/