Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-22 Thread Konrad Rzeszutek Wilk
Boris Ostrovsky wrote: >On 01/13/2014 04:30 AM, Olaf Hering wrote: >> On Fri, Jan 10, Boris Ostrovsky wrote: >> >>> 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-22 Thread Konrad Rzeszutek Wilk
Boris Ostrovsky boris.ostrov...@oracle.com wrote: On 01/13/2014 04:30 AM, Olaf Hering wrote: On Fri, Jan 10, Boris Ostrovsky wrote: 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-14 Thread David Vrabel
On 14/01/14 02:11, Boris Ostrovsky wrote: > On 01/13/2014 06:07 PM, Olaf Hering wrote: >> On Mon, Jan 13, Boris Ostrovsky wrote: >> >>> On 01/13/2014 04:30 AM, Olaf Hering wrote: > Similarly, if xenbug_gather("discard-secure") fails, I think the > code will > assume that secure discard

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-14 Thread David Vrabel
On 14/01/14 02:11, Boris Ostrovsky wrote: On 01/13/2014 06:07 PM, Olaf Hering wrote: On Mon, Jan 13, Boris Ostrovsky wrote: On 01/13/2014 04:30 AM, Olaf Hering wrote: Similarly, if xenbug_gather(discard-secure) fails, I think the code will assume that secure discard has not been requested.

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Boris Ostrovsky
On 01/13/2014 06:07 PM, Olaf Hering wrote: On Mon, Jan 13, Boris Ostrovsky wrote: On 01/13/2014 04:30 AM, Olaf Hering wrote: 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Olaf Hering
On Mon, Jan 13, Boris Ostrovsky wrote: > On 01/13/2014 04:30 AM, Olaf Hering wrote: > >>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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Boris Ostrovsky
On 01/13/2014 04:30 AM, Olaf Hering wrote: On Fri, Jan 10, Boris Ostrovsky wrote: 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Olaf Hering
On Fri, Jan 10, Boris Ostrovsky wrote: > 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.

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Olaf Hering
On Fri, Jan 10, Boris Ostrovsky wrote: 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.

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Boris Ostrovsky
On 01/13/2014 04:30 AM, Olaf Hering wrote: On Fri, Jan 10, Boris Ostrovsky wrote: 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Olaf Hering
On Mon, Jan 13, Boris Ostrovsky wrote: On 01/13/2014 04:30 AM, Olaf Hering wrote: 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. There

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-13 Thread Boris Ostrovsky
On 01/13/2014 06:07 PM, Olaf Hering wrote: On Mon, Jan 13, Boris Ostrovsky wrote: On 01/13/2014 04:30 AM, Olaf Hering wrote: 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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Boris Ostrovsky
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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Olaf Hering
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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Boris Ostrovsky
On 01/10/2014 11:28 AM, Olaf Hering wrote: In its initial implementation a check for "type" was added, but only phy and file are handled. This breaks advertised discard support for other type values such as qdisk. Fix and simplify this function: If the backend advertises discard support it is

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Boris Ostrovsky
On 01/10/2014 11:28 AM, Olaf Hering wrote: In its initial implementation a check for type was added, but only phy and file are handled. This breaks advertised discard support for other type values such as qdisk. Fix and simplify this function: If the backend advertises discard support it is

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Olaf Hering
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

Re: [PATCH] xen-blkfront: remove type check from blkfront_setup_discard

2014-01-10 Thread Boris Ostrovsky
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