linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-doc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	 linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	 Jonathan Corbet <corbet@lwn.net>,
	osalvador@suse.de, shuah@kernel.org,
	 Zhao Gongyi <zhaogongyi@huawei.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	 Yicong Yang <yangyicong@hisilicon.com>
Subject: Re: [PATCH -v2] lib/notifier-error-inject: fix error when writing errno to debugfs file
Date: Mon, 19 Sep 2022 20:40:38 +0900	[thread overview]
Message-ID: <CAC5umyhhnoJvoGT5NQX8VNn4QT_3qA1nY5tnZre59pL7vbMpzg@mail.gmail.com> (raw)
In-Reply-To: <93c044ca-7d2f-e23f-8eb4-72c133737a15@redhat.com>

2022年9月19日(月) 18:20 David Hildenbrand <david@redhat.com>:
>
> On 17.09.22 09:14, 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()"), so we can no longer use DEFINE_SIMPLE_ATTRIBUTE() to
> > define a file operations for errno value.
> >
> > Fixes: 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()")
> > Reported-by: Zhao Gongyi <zhaogongyi@huawei.com>
> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>
> But shouldn't we fix simple_attr_write() instead?
>
> I mean, simple_attr_read() might use attr->fmt to print a signed value,
> but simple_attr_write() fails on signed values now?
>
> I might be wrong, but there is a disconnect. I feel like
> simple_attr_write() should similarly make decisions based on attr->fmt.

I agree there is a disconnect, but I have no idea how to fix
simple_attr_write().
(strcmp(attr->fmt, "%%lld\n") is ugly)
If no one seems to come up with a good idea, I'll fix the similar problems
in fault-injection the same way I did here.


  reply	other threads:[~2022-09-19 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  7:14 [PATCH -v2] lib/notifier-error-inject: fix error when writing errno to debugfs file Akinobu Mita
2022-09-19  9:20 ` David Hildenbrand
2022-09-19 11:40   ` Akinobu Mita [this message]
2022-09-19 11:54     ` David Hildenbrand

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=CAC5umyhhnoJvoGT5NQX8VNn4QT_3qA1nY5tnZre59pL7vbMpzg@mail.gmail.com \
    --to=akinobu.mita@gmail.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=shuah@kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=yangyicong@hisilicon.com \
    --cc=zhaogongyi@huawei.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).