Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3606973rwb; Tue, 20 Sep 2022 02:01:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63saz0B8A0zmO2CPXepBmoYoPb2+rgR7fpfPqS3rEZ6DzteCwuztNDRQMuoBqgK/K+KQHV X-Received: by 2002:a17:907:96ab:b0:779:b7d8:41ba with SMTP id hd43-20020a17090796ab00b00779b7d841bamr16231209ejc.449.1663664489543; Tue, 20 Sep 2022 02:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663664489; cv=none; d=google.com; s=arc-20160816; b=I+aZn5ikIIAA5jd+w0KI3h47mvzMalf53GsWOLR4Bwtdf1lXR1hCtLfl4frEIW+NRR 0n2ZerB6OLt2gTY9/Vm7HSKCDP1bu1yERdynwJ1Nwq1hnKxsOrW7B4gKUZa7WUCi/L8v fTSCUHBh/cBmWHMCoEC6QtbVuxwuCxqhqXmCq73v7mnozp5M5Jcna6p4yKnXFkzVjE/n 61/Zs8PASuXTZuEwWhGvITUhmW2EISDd3VBl6vlNlrbmMP/w6nvVV8Nikzv712ofO+I8 aVJkONR+AePa+qkaKqnjwxEs3Z/wLc3Unyk16AM1/XEQ+khw3bBtu1CSBJA0fGjgUgJm FXpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:user-agent:mime-version:date :message-id:subject:dkim-signature; bh=VMI90VsaFAznWdudY3c2Y8bpe/V3g+agyL0jxa8IuF4=; b=jM3X3UPsyuxk1fUPJL8R8MlgBfe+FVrsrpgMfKEEY+1VWysrnF0U5c1WRyLOP9K6KC 92fqWLmT4J2Pq80MbJDVa6h6u2a3LS4vx/PQl+CCLgsthr9gTb3l8Eqjx67KIKX6cl4p Tox9yksLWLq8JQJUKSM67iodXOZS32DtcZFc1yuBGOgRtb4RVkFm5tp527uwnevjhSYo 867lgrSvDMtZmH52QkHp0ipwX+r/0GDD7YKxBaz2qRKDX6iKswy7UjUuMNfyoVpBvsK4 mRqwQWyhmHYtGkMct8oa4ZNXD9anRsW4z+E18i4MutC0CrrF3ZcXECdZJz+F/7ulI+is un5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=pmmZZwlF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw9-20020a170907a0c900b007815a44de91si936211ejc.771.2022.09.20.02.01.01; Tue, 20 Sep 2022 02:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=pmmZZwlF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiITIdA (ORCPT + 99 others); Tue, 20 Sep 2022 04:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbiITIco (ORCPT ); Tue, 20 Sep 2022 04:32:44 -0400 Received: from smtp-fw-9103.amazon.com (smtp-fw-9103.amazon.com [207.171.188.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02E2B1277E; Tue, 20 Sep 2022 01:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1663662763; x=1695198763; h=message-id:date:mime-version:to:cc:references:from: in-reply-to:content-transfer-encoding:subject; bh=VMI90VsaFAznWdudY3c2Y8bpe/V3g+agyL0jxa8IuF4=; b=pmmZZwlFGh21UmGmFUZHaiH/UOZTbefz5tEOU1KumvlazQnzlpoZJscY 4GduEfHqpEn7ctHEluZ42lAsCr+bNR6hLiu5xrzacL9UGWZLbAQP+J++8 VofGhLLdIAO+8Sm1ZI13Z1jQ8ofrAEAL/7sIWRXNPx5W0lWYzwtRNg98J 4=; X-IronPort-AV: E=Sophos;i="5.93,330,1654560000"; d="scan'208";a="1056013639" Subject: Re: [PATCH] libfs: fix negative value support in simple_attr_write() Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-54a073b7.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 08:27:36 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-54a073b7.us-east-1.amazon.com (Postfix) with ESMTPS id 3C907A287C; Tue, 20 Sep 2022 08:27:35 +0000 (UTC) Received: from EX19D013UWB003.ant.amazon.com (10.13.138.111) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Tue, 20 Sep 2022 08:27:33 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX19D013UWB003.ant.amazon.com (10.13.138.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.12; Tue, 20 Sep 2022 08:27:33 +0000 Received: from [192.168.162.64] (10.85.143.179) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.38 via Frontend Transport; Tue, 20 Sep 2022 08:27:28 +0000 Message-ID: Date: Tue, 20 Sep 2022 11:27:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 To: Andrew Morton CC: , , , , , , , Akinobu Mita , "Farber, Eliav" References: <20220918135036.33595-1-farbere@amazon.com> <20220919142413.c294de0777dcac8abe2d2f71@linux-foundation.org> Content-Language: en-US From: "Farber, Eliav" In-Reply-To: <20220919142413.c294de0777dcac8abe2d2f71@linux-foundation.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/20/2022 12:24 AM, Andrew Morton wrote: > On Sun, 18 Sep 2022 13:50:36 +0000 Eliav Farber > 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