[PATCH 0/3] fix error when writing negative value to simple attribute files

Akinobu Mita posted 3 patches 3 years, 6 months ago
.../fault-injection/fault-injection.rst       | 10 +++----
fs/debugfs/file.c                             | 28 +++++++++++++++----
fs/libfs.c                                    | 22 +++++++++++++--
include/linux/debugfs.h                       | 19 +++++++++++--
include/linux/fs.h                            | 12 ++++++--
lib/notifier-error-inject.c                   |  2 +-
6 files changed, 73 insertions(+), 20 deletions(-)
[PATCH 0/3] fix error when writing negative value to simple attribute files
Posted by Akinobu Mita 3 years, 6 months ago
The simple attribute files do not accept a negative value since the
commit 488dac0c9237 ("libfs: fix error cast of negative value in
simple_attr_write()"), but some attribute files want to accept
a negative value.

Akinobu Mita (3):
  libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
  lib/notifier-error-inject: fix error when writing -errno to debugfs
    file
  debugfs: fix error when writing negative value to atomic_t debugfs
    file

 .../fault-injection/fault-injection.rst       | 10 +++----
 fs/debugfs/file.c                             | 28 +++++++++++++++----
 fs/libfs.c                                    | 22 +++++++++++++--
 include/linux/debugfs.h                       | 19 +++++++++++--
 include/linux/fs.h                            | 12 ++++++--
 lib/notifier-error-inject.c                   |  2 +-
 6 files changed, 73 insertions(+), 20 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] fix error when writing negative value to simple attribute files
Posted by Zhao Gongyi 3 years, 6 months ago
On Tue, 20 Sep 2022 02:24:15 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> The simple attribute files do not accept a negative value since the
> commit 488dac0c9237 ("libfs: fix error cast of negative value in
> simple_attr_write()"), but some attribute files want to accept
> a negative value.
> 
> Akinobu Mita (3):
>   libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
>   lib/notifier-error-inject: fix error when writing -errno to debugfs
>     file
>   debugfs: fix error when writing negative value to atomic_t debugfs
>     file
> 
>  .../fault-injection/fault-injection.rst       | 10 +++----
>  fs/debugfs/file.c                             | 28 +++++++++++++++----
>  fs/libfs.c                                    | 22 +++++++++++++--
>  include/linux/debugfs.h                       | 19 +++++++++++--
>  include/linux/fs.h                            | 12 ++++++--
>  lib/notifier-error-inject.c                   |  2 +-
>  6 files changed, 73 insertions(+), 20 deletions(-)

I have tested this version, it is ok.

Tested-by: Zhao Gongyi <zhaogongyi@huawei.com>
Re: [PATCH 0/3] fix error when writing negative value to simple attribute files
Posted by Greg Kroah-Hartman 3 years, 6 months ago
On Tue, Sep 20, 2022 at 02:24:15AM +0900, Akinobu Mita wrote:
> The simple attribute files do not accept a negative value since the
> commit 488dac0c9237 ("libfs: fix error cast of negative value in
> simple_attr_write()"), but some attribute files want to accept
> a negative value.
> 
> Akinobu Mita (3):
>   libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
>   lib/notifier-error-inject: fix error when writing -errno to debugfs
>     file
>   debugfs: fix error when writing negative value to atomic_t debugfs
>     file
> 
>  .../fault-injection/fault-injection.rst       | 10 +++----
>  fs/debugfs/file.c                             | 28 +++++++++++++++----
>  fs/libfs.c                                    | 22 +++++++++++++--
>  include/linux/debugfs.h                       | 19 +++++++++++--
>  include/linux/fs.h                            | 12 ++++++--
>  lib/notifier-error-inject.c                   |  2 +-
>  6 files changed, 73 insertions(+), 20 deletions(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>