From: Georgi Djakov <djakov@kernel.org>
To: Mike Tipton <quic_mdtipton@quicinc.com>, gregkh@linuxfoundation.org
Cc: rafael@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugfs: Fix __rcu type comparison warning
Date: Tue, 10 Oct 2023 00:45:32 +0300 [thread overview]
Message-ID: <d11a47c9-c422-47d8-9049-2743314a9924@kernel.org> (raw)
In-Reply-To: <20230922134512.5126-1-quic_mdtipton@quicinc.com>
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 <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202309091933.BRWlSnCq-lkp@intel.com/
> Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Reviewed-by: Georgi Djakov <djakov@kernel.org>
> ---
> 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);
>
prev parent reply other threads:[~2023-10-09 21:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 13:45 Mike Tipton
2023-10-09 21:45 ` Georgi Djakov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d11a47c9-c422-47d8-9049-2743314a9924@kernel.org \
--to=djakov@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_mdtipton@quicinc.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®