Anand Jain
2fc37a0abf
btrfs: prop: fix vanished compression property after failed set
...
commit 272e5326c7837697882ce3162029ba893059b616 upstream.
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: stable@vger.kernel.org # 4.14+
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-17 08:37:53 +02:00
..
2019-03-23 14:35:09 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:47 +02:00
2018-07-08 15:30:51 +02:00
2019-03-13 14:03:19 -07:00
2017-11-02 11:10:55 +01:00
2018-12-01 09:42:51 +01:00
2019-04-17 08:37:53 +02:00
2018-12-17 09:28:53 +01:00
2019-02-27 10:08:01 +01:00
2019-04-05 22:31:28 +02:00
2017-11-24 08:37:05 +01:00
2018-11-21 09:24:15 +01:00
2018-11-13 11:15:12 -08:00
2018-08-03 07:50:32 +02:00
2019-02-15 08:09:12 +01:00
2019-03-23 14:35:21 +01:00
2019-02-12 19:45:57 +01:00
2018-06-21 04:02:42 +09:00
2017-07-11 06:09:21 -04:00
2017-11-02 11:10:55 +01:00
2018-11-27 16:10:47 +01:00
2018-12-17 09:28:50 +01:00
2019-03-23 14:35:23 +01:00
2019-04-05 22:31:24 +02:00
2019-04-05 22:31:27 +02:00
2018-11-04 14:52:47 +01:00
2018-12-17 09:28:53 +01:00
2019-02-12 19:46:11 +01:00
2019-03-13 14:03:23 -07:00
2018-12-17 09:28:54 +01:00
2018-12-17 09:28:54 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-03-13 14:03:10 -07:00
2018-10-03 17:00:57 -07:00
2019-04-05 22:31:33 +02:00
2019-01-26 09:37:02 +01:00
2018-08-09 12:16:39 +02:00
2019-03-23 14:35:18 +01:00
2019-01-13 10:01:06 +01:00
2017-11-02 11:10:55 +01:00
2018-03-28 18:24:43 +02:00
2019-04-03 06:25:16 +02:00
2018-02-03 17:39:08 +01:00
2019-03-23 14:35:28 +01:00
2018-05-30 07:51:47 +02:00
2017-11-02 11:10:55 +01:00
2019-02-06 17:31:37 +01:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:31:27 +02:00
2017-11-02 11:10:55 +01:00
2018-06-26 08:06:33 +08:00
2018-11-21 09:24:17 +01:00
2019-04-03 06:25:19 +02:00
2019-01-26 09:37:02 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-01-26 09:37:05 +01:00
2017-09-06 17:27:26 -07:00
2018-11-27 16:10:46 +01:00
2017-11-02 11:10:55 +01:00
2018-09-05 09:26:32 +02:00
2018-09-05 09:26:41 +02:00
2018-12-17 09:28:48 +01:00
2018-12-29 13:39:11 +01:00
2019-03-27 14:13:52 +09:00
2018-05-30 07:51:47 +02:00
2018-12-05 19:41:16 +01:00
2018-12-21 14:13:04 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-04 19:05:15 -04:00
2017-09-14 18:13:32 -07:00
2018-09-26 08:38:09 +02:00
2017-11-02 11:10:55 +01:00
2018-06-26 08:06:33 +08:00
2019-02-15 09:08:56 +01:00
2019-01-23 08:09:50 +01:00
2019-04-05 22:31:28 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-26 11:02:14 +02:00
2019-02-06 17:31:34 +01:00
2019-03-05 17:58:01 +01:00
2019-03-13 14:03:18 -07:00
2019-02-12 19:46:10 +01:00
2019-03-13 14:03:11 -07:00
2017-12-17 15:07:59 +01:00
2017-11-02 11:10:55 +01:00
2017-08-28 00:50:23 -04:00
2019-04-05 22:31:28 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-03-05 17:58:01 +01:00
2018-07-17 11:39:27 +02:00
2017-09-13 09:11:44 -07:00
2018-11-10 07:48:33 -08:00
2018-10-03 17:00:53 -07:00
2017-07-12 16:26:00 -07:00
2018-10-03 17:00:53 -07:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:25 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-12-01 09:42:59 +01:00
2018-11-21 09:24:14 +01:00
2017-11-02 11:10:55 +01:00
2019-04-03 06:25:17 +02:00
2019-03-23 14:35:21 +01:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:31:33 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:28 +01:00
2017-11-02 11:10:55 +01:00
2019-03-23 14:35:21 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:47 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-12-21 14:13:04 +01:00
2017-11-02 11:10:55 +01:00
2018-10-10 08:54:27 +02:00