From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B54146B7 for ; Mon, 16 Jan 2023 16:40:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B94D6C433EF; Mon, 16 Jan 2023 16:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673887202; bh=HiQgfMtdrmKFp+G9IjrF+J61ktpyirNZMNi/eLUU7UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tEPxArVFxlBuFNtxbEvBMNH0HswC/BN/3Ws3uyl36dr9OYwe9EG8B/9r2uO2jBHEA yAGXkNeZDNJG9m7CJMpE7RNiGLJqbSmvZZdNr8EGghCs4MJFxLW4j4fGnR3o9BKQ0A +SuHxv9dREAslhRiON17bCWQe2rjFXx1X2WMJUFc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Akinobu Mita , Zhao Gongyi , David Hildenbrand , Alexander Viro , Jonathan Corbet , Oscar Salvador , "Rafael J. Wysocki" , Shuah Khan , Wei Yongjun , Yicong Yang , Andrew Morton , Sasha Levin Subject: [PATCH 4.19 059/521] lib/notifier-error-inject: fix error when writing -errno to debugfs file Date: Mon, 16 Jan 2023 16:45:21 +0100 Message-Id: <20230116154849.881598304@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154847.246743274@linuxfoundation.org> References: <20230116154847.246743274@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Akinobu Mita [ Upstream commit f883c3edd2c432a2931ec8773c70a570115a50fe ] 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. Link: https://lkml.kernel.org/r/20220919172418.45257-3-akinobu.mita@gmail.com Fixes: 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()") Signed-off-by: Akinobu Mita Reported-by: Zhao Gongyi Reviewed-by: David Hildenbrand Reviewed-by: Greg Kroah-Hartman Cc: Alexander Viro Cc: Jonathan Corbet Cc: Oscar Salvador Cc: Rafael J. Wysocki Cc: Shuah Khan Cc: Wei Yongjun Cc: Yicong Yang Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- 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 eb4a04afea80..125ea8ce23a4 100644 --- a/lib/notifier-error-inject.c +++ b/lib/notifier-error-inject.c @@ -14,7 +14,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, -- 2.35.1