From patchwork Mon Sep 19 17:24:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 12980831 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 18FA3ECAAA1 for ; Mon, 19 Sep 2022 17:25:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E9D26B0071; Mon, 19 Sep 2022 13:24:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99783940009; Mon, 19 Sep 2022 13:24:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8382C6B0073; Mon, 19 Sep 2022 13:24:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 777326B0071 for ; Mon, 19 Sep 2022 13:24:59 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 498141C614C for ; Mon, 19 Sep 2022 17:24:59 +0000 (UTC) X-FDA: 79929510318.03.5F493AA Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf30.hostedemail.com (Postfix) with ESMTP id F2DD280010 for ; Mon, 19 Sep 2022 17:24:58 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id j6-20020a17090a694600b00200bba67dadso6778065pjm.5 for ; Mon, 19 Sep 2022 10:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=bbpyEIxy2q5E0Mu0eFfeDQBjUZV6iZmC2F5w0SRo/n0=; b=Co/4gbdqV3wYszCUQb+RGNGJu20t0HKKIu5oDP6hA8o9BdkU2FmW7i7IcL+7qo2PaC gM4RjQzS/YttfgyX5aTlw6dn83JpW5nnVlJPkKOC2VdS3K56xvI+AGNZfBtbF/h1rFER ScpZLXretyLf+Rt5TNkDJFqMg/kQ2Ipeq1lo7ytmLUhfwl5T7t+p5MOqXuiRfV4iyrJp Q8j82WniFh2z9s041bYtoTiYgUNtESbIF5HpSuNW1z0aCwe1479MPo92D2QSvDuadXob nNC7P8bvFcBWcvO0WucpeKiFL4sbIyYia87lUj0/OSbuGM0B/3hp4Okx1oAQO7TWN6UM a+5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=bbpyEIxy2q5E0Mu0eFfeDQBjUZV6iZmC2F5w0SRo/n0=; b=pM+E2hbMdoBE8YGl8ogGli55PE9xvfGCNim9Tz1bM/rm/q8LCzMH7U3W24YL8Mfe2q HcA3xLZR9msrm1eGgogOULJsOJtocsb8x9NRm0fVq+z6tKANovkjFi8A2njPXQbLXzei ZgZ+8a9LBIEGA5v3LUB2Tqoi/6V1WVPNIJ8nfbSvBWZs/uSIkrdHsp4Zdn9YOxY31CjC d/jGLRsn5wXdFz1xWCWS+qlPiXQu+zGxz0UnQ7OsaoqV/I+BpAJDMWg9ArgrWMXc6ZMF UfORPCX4k+M1T+N22FWvH3RYiUG/AzUoWW/8NivSHKCuMCIVFrrCYz+FUpBR7YQJQlho KPQg== X-Gm-Message-State: ACrzQf3ysJvtjcqrtfzQJvrLOaG5M6lPzBSyTUEEjm+tW10QA2fY2tHs JvOCNYT6A9ZyU8AiMWr/WvA= X-Google-Smtp-Source: AMsMyM6Qrw6HZuNf6rIjays5IloSGiOAoofUELKN7KLJpWX1ntXV4kAENP3WaVkLwjI5RbzGYGwmPw== X-Received: by 2002:a17:90a:ac10:b0:202:9880:4cae with SMTP id o16-20020a17090aac1000b0020298804caemr20626018pjq.173.1663608297969; Mon, 19 Sep 2022 10:24:57 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:24:57 -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 2/3] lib/notifier-error-inject: fix error when writing -errno to debugfs file Date: Tue, 20 Sep 2022 02:24:17 +0900 Message-Id: <20220919172418.45257-3-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220919172418.45257-1-akinobu.mita@gmail.com> References: <20220919172418.45257-1-akinobu.mita@gmail.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663608298; 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:in-reply-to:references:references:dkim-signature; bh=bbpyEIxy2q5E0Mu0eFfeDQBjUZV6iZmC2F5w0SRo/n0=; b=rY8IqBuVdP27Vufc3CVKTrWSHyyjnRMpsyYNd/nJOyhLnCkcVklfp46YnVWxDY6r8d8aPd nT4ciW0/hyAd6tbHhCBiBNeYh18iMb/yDqAqgEFNqahR3AZK5TdNDgs1/mJScCfTPeWQCO 9UGBlcxasB+619riOcN3ylKrYzB9PIc= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Co/4gbdq"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of akinobu.mita@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=akinobu.mita@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663608299; a=rsa-sha256; cv=none; b=C/+PKdFP4oBbH2kiTyVmAS+qYf+kiVfpzipFi/znTo5lOw4uHlGJlS5uS/Lf/TJZ2VTQM7 VAzU3WFF+hK+7aiGAfOPvvEBNWQ2TEIo7dd4S5OUJKXonUFuzB+Th/q1hBFK73gQ2LQ4hm uNmpDY1PzZB6ZkQaRCFH42MKwGFbq6c= X-Stat-Signature: p7w3s5p3m481c9m1ddcbfi8xgtm5emcw X-Rspamd-Queue-Id: F2DD280010 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Co/4gbdq"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of akinobu.mita@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=akinobu.mita@gmail.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1663608298-553601 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()"). This restores the previous behaviour by using newly introduced DEFINE_SIMPLE_ATTRIBUTE_SIGNED instead of DEFINE_SIMPLE_ATTRIBUTE. Fixes: 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()") Reported-by: Zhao Gongyi Signed-off-by: Akinobu Mita Reviewed-by: David Hildenbrand --- lib/notifier-error-inject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/notifier-error-inject.c b/lib/notifier-error-inject.c index 21016b32d313..2b24ea6c9497 100644 --- a/lib/notifier-error-inject.c +++ b/lib/notifier-error-inject.c @@ -15,7 +15,7 @@ static int debugfs_errno_get(void *data, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(fops_errno, debugfs_errno_get, debugfs_errno_set, +DEFINE_SIMPLE_ATTRIBUTE_SIGNED(fops_errno, debugfs_errno_get, debugfs_errno_set, "%lld\n"); static struct dentry *debugfs_create_errno(const char *name, umode_t mode,