From patchwork Mon Sep 19 17:24:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 12980829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E8D3ECAAD3 for ; Mon, 19 Sep 2022 17:24:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D163940007; Mon, 19 Sep 2022 13:24:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 181C06B0072; Mon, 19 Sep 2022 13:24:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0492D940007; Mon, 19 Sep 2022 13:24:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EAEDB6B0071 for ; Mon, 19 Sep 2022 13:24:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B727312060F for ; Mon, 19 Sep 2022 17:24:51 +0000 (UTC) X-FDA: 79929509982.13.F97487E Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf24.hostedemail.com (Postfix) with ESMTP id 65D43180004 for ; Mon, 19 Sep 2022 17:24:51 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so6784478pjh.3 for ; Mon, 19 Sep 2022 10:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=yLXbhdZTFJDz1Eruum+B2eKRMi+oFeTFSm6260p2MLc=; b=CLcyONO1tRPGjoZAaIYtpv+BQUg6p73mrNktcLcwmrzTHqJzD2K7NR1GfWPSCBGPxE Yu2F92jKgBwkknxARDrGTifPH6MQk386kI0Sw7CZHJdP07ZR75qOh2W14DeRRgakdUNR nF3ibbpOsfMGK52NKZ0rwKUS2aAELJihMdlQ89i1XsXj7HqtU5/QYt5ETDqhUqRWVbFq UaDax9f6skaAn+5zG+0Tcq/K/IbZ5LemJiiSqoQxvnP9sAZ8NoZ41jC8Aw1ldsY98lkA Y2sEvfDJAtYboaLm00hKcoCpOi7+rvCaHRpeZmD820MlkgG1eYb5KrMTIbFAU5Rw8Xk2 /1Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=yLXbhdZTFJDz1Eruum+B2eKRMi+oFeTFSm6260p2MLc=; b=o6X4ZmdGkTUYuxeqUD8dLnEeIN4j+BLBuTsmR9l4ybPSoIUBMQxOA3T5rZNTfydgD/ bZPCZPwZzRmyTTKylMNJwDsl178ZBI+Hk98GFpdDBigqPmmM9uUSS5C510m0i0nOZfSF ro/4XgJp9tr5qs+gbOZDk5oHgQ3uFZWMr5USqXzHIg6eVdvC5Aoq1AQvcvQYyvxQlCz/ /RL9qr1IYDnR+mcMPTkan5E3lDs/Old+92AXI79WZEMHTaeLFPFT1GTaFNsalo2jIDnP JTscyRAEywrZktGIaGQaylXzVY/HuhifVIVtkqksMGaKJZ32qxJ9UVwCBmVYd3XYme+V GSkA== X-Gm-Message-State: ACrzQf3KJikh9QeugCFBtEAnlww9Jf03WilecaQvN5MSYQxJUtQ/tmkR rxA0yImfjQQNVRbDKp32Z6k= X-Google-Smtp-Source: AMsMyM6VM/BivqDfuJDvVl6ZNbzXY/5NA1f7mD4YYRuIqm7xUhTzEi114h9ynNOaChL++gsvhYqEiw== X-Received: by 2002:a17:902:e94f:b0:16d:847b:3343 with SMTP id b15-20020a170902e94f00b0016d847b3343mr774637pll.103.1663608290154; Mon, 19 Sep 2022 10:24:50 -0700 (PDT) Received: from localhost.localdomain (KD027092233113.ppp-bb.dion.ne.jp. [27.92.233.113]) by smtp.gmail.com with ESMTPSA id h7-20020aa796c7000000b0053f2505318asm21226480pfq.142.2022.09.19.10.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:24:49 -0700 (PDT) From: Akinobu Mita To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-fsdevel@vger.kernel.org, corbet@lwn.net, david@redhat.com, osalvador@suse.de, shuah@kernel.org, Zhao Gongyi , Wei Yongjun , Yicong Yang , Greg Kroah-Hartman , "Rafael J. Wysocki" , Alexander Viro , akpm@linux-foundation.org Cc: Akinobu Mita Subject: [PATCH 0/3] fix error when writing negative value to simple attribute files Date: Tue, 20 Sep 2022 02:24:15 +0900 Message-Id: <20220919172418.45257-1-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663608291; a=rsa-sha256; cv=none; b=MnW4GQMd70rgSCibq7/V7x2hN9QDrxpGCe29D/jps3oce/SAotxoDV14jrJsva618nyLAK xDhk4qj4eBBBpQrMT4jKBWvmsAcHG6Gdbya1AV1UzlAI/Ut5bXA1PR77f3XJ7Ob+xBE0nY 66O0NoetrbiB0SCEFVNOO33dF8mJeyQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CLcyONO1; spf=pass (imf24.hostedemail.com: domain of akinobu.mita@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=akinobu.mita@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663608291; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=yLXbhdZTFJDz1Eruum+B2eKRMi+oFeTFSm6260p2MLc=; b=HtLWJfZcvWVKCQe2QoVtirLEWbikt2j7WvEBcurVS499RO2RUaSRPdbIhRZ38LuEbksfom HzqNY7/fXoAaGocK30L0gBktygopZVDZ/Tc7KBd2CbaQAWQorn2FlAB4x+eGPScj2a5OZP rUeLlvRaUAPvCbdMUDkqI7ThILo2fF8= X-Rspamd-Queue-Id: 65D43180004 X-Rspamd-Server: rspam05 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CLcyONO1; spf=pass (imf24.hostedemail.com: domain of akinobu.mita@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=akinobu.mita@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: hbmzzs8ugijd6khcgj7k4651me5zh1ft X-HE-Tag: 1663608291-1360 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Tested-by: Zhao Gongyi