Re: [PATCH] loop: Call loop_config_discard() only after new config is applied.

From: Christoph Hellwig
Date: Tue Apr 14 2020 - 04:17:00 EST


On Tue, Mar 31, 2020 at 01:41:16PM +0200, Martijn Coenen wrote:
> loop_set_status() calls loop_config_discard() to configure discard for
> the loop device; however, the discard configuration depends on whether
> the loop device uses encryption, and when we call it the encryption
> configuration has not been updated yet. Move the call down so we apply
> the correct discard configuration based on the new configuration.
>
> Signed-off-by: Martijn Coenen <maco@xxxxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>