Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2153889rdb; Mon, 9 Oct 2023 14:46:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKNQ5TkjMl7YVLicWROMVMo0TlH/ptCPeryYAZg0LZ7NIWYeVpytDhTtPFhefDPHPwwGqv X-Received: by 2002:a05:6808:2112:b0:3af:6634:49b9 with SMTP id r18-20020a056808211200b003af663449b9mr22458742oiw.30.1696887970701; Mon, 09 Oct 2023 14:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696887970; cv=none; d=google.com; s=arc-20160816; b=n+3wsWtfusnly9zzC9MFcDkiJ10HZW7pgN0yq6kVRXHaUpYNie3vLAhm+ltbjWfgh4 pSpO9ISCYLJ+6KJfcHVi2Jo5Cm6FnsTKD2L6qNRK9DlZxHPkNev3sFgFva4htQhR08Sc NF6qU7dRxpt5oYSwjqen4VGUg5ZBGjJyHw/rGjwSTNtqHSax852yoIoiZJj1Ie26W4sS 1Egzk93YLAnu3QxW3Zbl1ercHwBFy+3PsRH2f8thUcWIlf7d/YNjErX99mMzlkFJD+2O 8SaL3Vz+yM+//7RMThp6ixhjCbJQ34c/Nbb7rjUHIpacOMxlL19bW/Tl68CuUdw3L1Le WsRg== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2hoggY/tjw0eS/RD/Wn5QkrY1hBjiUj2TZbCqr4DBmQ=; fh=BbhHEgjgwHIY7BdTT1zc3CoePPJ4q6y4aT+18Mk0Qgo=; b=LGPMdIoooNjZfhUs5gyUPeJKgQVA378uN8vEtJFXum9AcnowvyYC4vZOBuyH+SIu6H yfR0E8Fzgjx7y1Hf0BbwO4JuCRkEAub4u7xw5mo1gY+CBzH5L5lsQqv7Z3C04zhbMmXt D1CeBblm2vE8QXd8SLHjw/LD7jnDnhix8/mFfTNdJtzviZidIwQyh4NcTIkYHRSWL//O k6r9EPSMziywVz/8yYKGPsmEw0Un6/JXV3vtbFlfnL43+EGNdunJZRgjnqb9kTUl6qaa T7ae5EI9VujEEwQO2n4FM8tUXZypK8DoCbfsK9uttjRGymyxkvsBo2BdB1Ln0c6TpHTd 6oGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eAoIc2gU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id az1-20020a056a02004100b00578ccb95206si10188511pgb.745.2023.10.09.14.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 14:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eAoIc2gU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0819580E6C75; Mon, 9 Oct 2023 14:46:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378776AbjJIVpm (ORCPT + 99 others); Mon, 9 Oct 2023 17:45:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378530AbjJIVpk (ORCPT ); Mon, 9 Oct 2023 17:45:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CAD9D for ; Mon, 9 Oct 2023 14:45:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B73A2C433C8; Mon, 9 Oct 2023 21:45:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696887936; bh=1ndakU5ZrJNV6n/t729+HGi50h9X41d0pjJ8GuYWV7A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eAoIc2gU/zMHHHJw+1Cd/NcYRsM/noqrYMfeG/x7l54J43MQTDh4ewB0ykeNh2GDD L82gHRh0PzE3QqqCQox0srHMk7X4kj5w7+nhrva8wFgnjSIg+vsX3FWAm1QX91W7X3 yB5BZnVBN7x1WX3JdQH3fdV32isSeHR7LzaCkiqGDGhzkWlB4Oq0zdzb2d0DSPQJLD VJKsRoM+J2d9CsmevmZburewXWpZ0CjAeulY/5Z+NkdXaYQ6xHzXOprocL7ad8J3sQ J+bSO5uxsSwSrjn8VQUnx2Iq/4mfJLHdbwp3ZdHXBNdGJL+fcOzm/RYlWn/CBpvnle RRw038BUlJn0A== Message-ID: Date: Tue, 10 Oct 2023 00:45:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] debugfs: Fix __rcu type comparison warning Content-Language: en-US To: Mike Tipton , gregkh@linuxfoundation.org Cc: rafael@kernel.org, linux-kernel@vger.kernel.org References: <20230922134512.5126-1-quic_mdtipton@quicinc.com> From: Georgi Djakov In-Reply-To: <20230922134512.5126-1-quic_mdtipton@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 14:46:01 -0700 (PDT) X-Spam-Level: ** On 22.09.23 16:45, Mike Tipton wrote: > Sparse reports the following: > > fs/debugfs/file.c:942:9: sparse: sparse: incompatible types in comparison expression (different address spaces): > fs/debugfs/file.c:942:9: sparse: char [noderef] __rcu * > fs/debugfs/file.c:942:9: sparse: char * > > rcu_assign_pointer() expects that it's assigning to pointers annotated > with __rcu. We can't annotate the generic struct file::private_data, so > cast it instead. > > Fixes: 86b5488121db ("debugfs: Add write support to debugfs_create_str()") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202309091933.BRWlSnCq-lkp@intel.com/ > Signed-off-by: Mike Tipton Reviewed-by: Georgi Djakov > --- > fs/debugfs/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c > index 87b3753aa4b1..c45e8c2d62e1 100644 > --- a/fs/debugfs/file.c > +++ b/fs/debugfs/file.c > @@ -939,7 +939,7 @@ static ssize_t debugfs_write_file_str(struct file *file, const char __user *user > new[pos + count] = '\0'; > strim(new); > > - rcu_assign_pointer(*(char **)file->private_data, new); > + rcu_assign_pointer(*(char __rcu **)file->private_data, new); > synchronize_rcu(); > kfree(old); >