Files
linux/include/linux
Akinobu Mita 111e540304 libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
[ Upstream commit 2e41f274f9 ]

Patch series "fix error when writing negative value to simple attribute
files".

The simple attribute files do not accept a negative value since the commit
488dac0c92 ("libfs: fix error cast of negative value in
simple_attr_write()"), but some attribute files want to accept a negative
value.

This patch (of 3):

The simple attribute files do not accept a negative value since the commit
488dac0c92 ("libfs: fix error cast of negative value in
simple_attr_write()"), so we have to use a 64-bit value to write a
negative value.

This adds DEFINE_SIMPLE_ATTRIBUTE_SIGNED for a signed value.

Link: https://lkml.kernel.org/r/20220919172418.45257-1-akinobu.mita@gmail.com
Link: https://lkml.kernel.org/r/20220919172418.45257-2-akinobu.mita@gmail.com
Fixes: 488dac0c92 ("libfs: fix error cast of negative value in simple_attr_write()")
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reported-by: Zhao Gongyi <zhaogongyi@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-07 12:07:14 +01:00
..
2022-10-26 13:15:43 +02:00
2017-10-08 10:26:06 +02:00
2016-09-14 09:18:06 -06:00
2022-08-25 11:09:24 +02:00
2018-02-28 10:18:33 +01:00
2017-05-14 14:00:22 +02:00
2019-11-25 09:53:14 +01:00
2017-07-12 15:01:02 +02:00
2021-12-08 08:45:06 +01:00
2017-08-06 18:59:43 -07:00
2021-02-03 23:19:50 +01:00
2016-09-24 10:48:18 +02:00
2021-03-30 14:41:41 +02:00
2016-10-20 15:51:28 +11:00
2016-09-16 09:34:15 +01:00
2016-09-14 09:18:09 -06:00
2018-10-10 08:53:18 +02:00
2016-08-10 11:23:44 -04:00
2020-04-02 17:20:40 +02:00
2016-09-15 16:49:39 +02:00
2021-11-26 11:48:18 +01:00
2016-09-27 12:33:47 +02:00
2017-08-24 17:12:19 -07:00
2021-07-11 12:46:40 +02:00
2016-07-29 12:17:52 -07:00
2016-10-19 11:36:22 -06:00
2020-11-18 18:26:29 +01:00
2020-03-20 09:07:43 +01:00
2017-08-24 17:12:21 -07:00
2016-10-14 11:36:59 -07:00
2016-09-27 21:52:00 -04:00
2016-09-08 15:01:10 -07:00
2016-09-08 22:15:25 -07:00
2020-04-02 17:20:39 +02:00
2017-08-30 10:21:40 +02:00
2016-08-28 23:44:55 -04:00
2016-10-05 18:23:36 -04:00
2018-11-13 11:17:02 -08:00
2020-12-11 13:38:00 +01:00
2017-04-21 09:31:21 +02:00
2016-07-26 16:19:19 -07:00
2022-06-25 11:45:10 +02:00
2017-12-25 14:23:37 +01:00
2020-04-02 17:20:39 +02:00
2021-12-14 10:04:48 +01:00