From: Vitaly Kuznetsov Date: Mon, 1 Dec 2014 13:01:13 +0000 (+0100) Subject: xen/blkfront: improve protection against issuing unsupported REQ_FUA X-Git-Tag: omap-for-v3.19/fixes-rc1~94^2~3^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad42d391ae388bd4ce4d53e8d7b4089cfdcba411;p=pandora-kernel.git xen/blkfront: improve protection against issuing unsupported REQ_FUA Guard against issuing unsupported REQ_FUA and REQ_FLUSH was introduced in d11e61583 and was factored out into blkif_request_flush_valid() in 0f1ca65ee. However: 1) This check in incomplete. In case we negotiated to feature_flush = REQ_FLUSH and flush_op = BLKIF_OP_FLUSH_DISKCACHE (so FUA is unsupported) FUA request will still pass the check. 2) blkif_request_flush_valid() is misnamed. It is bool but returns true when the request is invalid. 3) When blkif_request_flush_valid() fails -EIO is being returned. It seems that -EOPNOTSUPP is more appropriate here. Fix all of the above issues. This patch is based on the original patch by Laszlo Ersek and a comment by Jeff Moyer. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Laszlo Ersek Reviewed-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk --- Reading git-diff-tree failed