linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Farber, Eliav" <farbere@amazon.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <viro@zeniv.linux.org.uk>, <yangyicong@hisilicon.com>,
	<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<andriy.shevchenko@intel.com>, <hhhawa@amazon.com>,
	<jonnyc@amazon.com>, Akinobu Mita <akinobu.mita@gmail.com>,
	"Farber, Eliav" <farbere@amazon.com>
Subject: Re: [PATCH] libfs: fix negative value support in simple_attr_write()
Date: Tue, 20 Sep 2022 11:27:25 +0300	[thread overview]
Message-ID: <f75a7d97-58cb-9136-093b-bf5af48da99a@amazon.com> (raw)
In-Reply-To: <20220919142413.c294de0777dcac8abe2d2f71@linux-foundation.org>

On 9/20/2022 12:24 AM, Andrew Morton wrote:
> On Sun, 18 Sep 2022 13:50:36 +0000 Eliav Farber <farbere@amazon.com> 
> wrote:
>
>> After commit 488dac0c9237 ("libfs: fix error cast of negative value in
>> simple_attr_write()"), a user trying set a negative value will get a
>> '-EINVAL' error, because simple_attr_write() was modified to use
>> kstrtoull() which can handle only unsigned values, instead of
>> simple_strtoll().
>>
>> This breaks all the places using DEFINE_DEBUGFS_ATTRIBUTE() with format
>> of a signed integer.
>>
>> The u64 value which attr->set() receives is not an issue for negative
>> numbers.
>> The %lld and %llu in any case are for 64-bit value. Representing it as
>> unsigned simplifies the generic code, but it doesn't mean we can't keep
>> their signed value if we know that.
>>
>> This change basically reverts the mentioned commit, but uses kstrtoll()
>> instead of simple_strtoll() which is obsolete.
>>
>
> https://lkml.kernel.org/r/20220919172418.45257-1-akinobu.mita@gmail.com
> addresses the same thing.
>
> Should the final version of this fix be backported into -stable trees?


I think that my patch can be dropped in favor of Akinobu's patch.

--
Regards, Eliav


  reply	other threads:[~2022-09-20  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 13:50 [PATCH] libfs: fix negative value support in simple_attr_write() Eliav Farber
2022-09-19  8:28 ` Yicong Yang
2022-09-19 21:24 ` Andrew Morton
2022-09-20  8:27   ` Farber, Eliav [this message]
2022-09-20 12:48   ` VS: " Shevchenko, Andriy
2022-09-21 14:39   ` Andy Shevchenko
2022-09-21 14:40     ` Andy Shevchenko
2022-09-23 16:59 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f75a7d97-58cb-9136-093b-bf5af48da99a@amazon.com \
    --to=farbere@amazon.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=hhhawa@amazon.com \
    --cc=jonnyc@amazon.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).