diff options
| author | Anand Jain <[email protected]> | 2019-04-02 18:07:40 +0800 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2019-04-04 17:57:53 +0200 |
| commit | 272e5326c7837697882ce3162029ba893059b616 (patch) | |
| tree | be2f5760d1a6892503ef14f29b564531a0d75671 /drivers/gpu/drm/omapdrm/omap_irq.c | |
| parent | 50398fde997f6be8faebdb5f38e9c9c467370f51 (diff) | |
btrfs: prop: fix vanished compression property after failed set
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 length passed from the userspace.
Fix it by using the expected string length in strncmp().
Fixes: 63541927c8d1 ("Btrfs: add support for inode properties")
Fixes: 5c1aab1dd544 ("btrfs: Add zstd support")
CC: [email protected] # 4.14+
Reviewed-by: Nikolay Borisov <[email protected]>
Signed-off-by: Anand Jain <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_irq.c')
0 files changed, 0 insertions, 0 deletions