On Tue, Apr 02, 2019 at 06:07:40PM +0800, Anand Jain wrote: > The compression property resets to NULL, instead of the old value if we > fail to set the new compression parameter. > > btrfs prop get /btrfs compression > compression=lzo > btrfs prop set /btrfs compression zli > ERROR: failed to set compression for /btrfs: Invalid argument > btrfs prop get /btrfs compression > > This is because the compression property ->validate() is successful for > 'zli' as the strncmp() used the len passed from the userland. > > Fix it by using the expected string length in strncmp(). > > Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: David Sterba <dste...@suse.com>