dm thin: fix pool target flags that control discard
On Fri, Mar 23 2012 at 8:37am -0400,
Alasdair G Kergon <agk@redhat.com> wrote:
> On Fri, Mar 16, 2012 at 03:22:34PM +0000, Joe Thornber wrote:
> > + 'ignore_discard': disable discard support
> > + 'no_discard_passdown': don't pass discards down to the underlying data device
>
> If someone reloads the pool target changing either of these options, how do connected
> thin targets pick up the change? If they don't pick it up automatically, how do you
> determine whether they did or didn't pick it up - is that internal state not
> exposed to userspace yet?
Here are various fixes for dm_thin-add-pool-target-flags-to-control-discard.patch
o wire up 'discard_passdown' so that it does control whether or not the
discard is passed to the pool's underlying data device
o disallow disabling discards if a pool was already configured with
discards enabled (the default)
- justification is inlined in the code
- required pool_ctr knowing whether pool was created or not; so added
'created' flag to __pool_find()
o if 'discard_passdown' is enabled (the default) verify that the pool's
data device supports discards; if not warn and disable discard_passdown
o the pool device's discard support should _not_ be limited by whether
'discard_passdown' is enabled or not.