Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2055617lfo; Fri, 20 May 2022 11:44:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Mt+wijxujdc4lVpJlZI0ZVU+LGVxjCEKa1xaBLpX0Xb06EnlNWqtXeILLSE1vnT7oUvO X-Received: by 2002:aa7:da8d:0:b0:42a:aa60:8af3 with SMTP id q13-20020aa7da8d000000b0042aaa608af3mr12315955eds.94.1653072249355; Fri, 20 May 2022 11:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653072249; cv=none; d=google.com; s=arc-20160816; b=FcO/91sRwN2PIZicOxsuSuYuNtZPo5dkrrI0P7Bp4JT0GGIbM5zy/D10K2YwMgZzwA JBfBNp2/4HGZupYYC9um8MRkQFU+564r1nC+Ot8DN8nPSP9Hb0Hp4ztRtpI74QrSqxRU gJjn32Wo2iw9xPJvYG92Qi9HzdCiCcxWb5rfhFpeeZaZS6vH8rUQmfsgNreHrtDlRzYW F0CWZ6ZivqfgVzQf2CCOxoanI68gJ8fLIhgIl7PfDPIoGaA21+rZYFxgHpuL9ExmBNSH e74Yxzn6a5xRaxs1+g3tRR9DSnr9xE6TjSmHeobEIu/LDTngp5D1wa/Sb8qweWbwvk9u pTzA== 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 :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=v/9u8Imy9wLRfYHBxZ32XU6PyvAPyOYsjrvd7MK9l3c=; b=AwCvFjTP4kU7K1xzg6MRREDFdtg9zggw0TEtSdBO8nISOUjl5YS6A+zrcdfBViV8AP qfGCrJb+YEgPR2GxilJOmN1TZma545dtSEwIzj8tLvqk0VXwHEmDlNVdsNve2tHn7704 F93ciUQ64RF9w6txUag+w9Que61M7SqzJuF9U2QiUb5xbj2XJ/wcWbPsVCT5tzliwTaZ g5Nh/MdvJbb5SBjJOfey8L5sVSVnQ8MvP/LzgTlawe8yzntDYZgegwAM5ZHdjHDN9F1I D0mMcn8qQifDLCZJLh2Qg1eO0Wv+prGG4mr/SQg1X4nNyBLwtPXgobKLpCn+TUXW6Hxu BC3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=eaOE6+Y2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga20-20020a1709070c1400b006e0d79ad8bdsi9272919ejc.307.2022.05.20.11.43.42; Fri, 20 May 2022 11:44:09 -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=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=eaOE6+Y2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239782AbiESOaz (ORCPT + 99 others); Thu, 19 May 2022 10:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239777AbiESOay (ORCPT ); Thu, 19 May 2022 10:30:54 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B9C31BD for ; Thu, 19 May 2022 07:30:52 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id v8so7522522lfd.8 for ; Thu, 19 May 2022 07:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=v/9u8Imy9wLRfYHBxZ32XU6PyvAPyOYsjrvd7MK9l3c=; b=eaOE6+Y20AmRa6nSUYi7geIR7y/yn/2PASJIV5qzYyDB6uR6xRAVOuFN3V/UnNIH5M 26SZQjvVd+k+L58xBa0lL+d/7x36ah8wc87F8UlsMb5wc09DF4Pc5bn1Ue9CNrngxEmQ rujvItsfN8DHXlCNtjEY9sOnjgY9+qPcFxdpugQM+pL8o3a9pjz/zI2ByEpjrazS9jj7 RxRiQ2McaC+Q1r0odu1Huw8tyIP9HnMsjz+7KMrlms6HUv3h5dGyFqEn+lOxlHWKHapY fG61sn3MSGPU7p9Zu9P4jkwlQ5oJYJXIZun/HOlHmFqzFhu0XGxWPN44Grct9Rn5NWjz yXUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=v/9u8Imy9wLRfYHBxZ32XU6PyvAPyOYsjrvd7MK9l3c=; b=oWufFMutDJg38PUoEq7PwuXfjLov8KavqnTliBqaWN6KdgZApz3BrDUtFBkfnB8JIW zi1nYzyT/lWZQLwPGuD7/c4EXhpUZqljOKYilXa8dwdznfn7KOGXBwQqRKRmAFJ2YunB sPifEeURWeJ8nCKep+K888KDY2UKfvNkTHIwhixz8Hb+edKtj/eLgUzurbSE6QUHpFWk KcXbL1oG8/kusUJYMNyVg5gqemUYv0+8e+YOExNVzO0CYJiezIprDu0Ybvrhken2Leve XiRo/UGH88USKzDPNbqI54ABmE4iQgI29xI+Hq/HX9sI+AFY7su5b2kHcUzT2NA4MZLT 9Jhw== X-Gm-Message-State: AOAM531iJCZMMjqv1pF9jJ8UERA2r5jy2hbGlUMNrt7BfxEExqC2Y+as bFhb+XhUgq5ZGyVn8+Fv9QVwvg== X-Received: by 2002:ac2:482f:0:b0:472:47d5:ef32 with SMTP id 15-20020ac2482f000000b0047247d5ef32mr3587303lft.344.1652970650876; Thu, 19 May 2022 07:30:50 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.185]) by smtp.gmail.com with ESMTPSA id d25-20020ac24c99000000b00477b624c0a8sm304402lfl.180.2022.05.19.07.30.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 07:30:50 -0700 (PDT) Message-ID: <6f009241-a63f-ae43-a04b-62841aaef293@openvz.org> Date: Thu, 19 May 2022 17:30:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 From: Vasily Averin Subject: [PATCH v3] io_uring: fix incorrect __kernel_rwf_t cast To: Christoph Hellwig , Jens Axboe Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, Pavel Begunkov , Steven Rostedt , Ingo Molnar References: <2eb22fb3-40cc-48f6-8ba9-5faeae0b43ff@kernel.dk> Content-Language: en-US In-Reply-To: <2eb22fb3-40cc-48f6-8ba9-5faeae0b43ff@kernel.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Currently 'make C=1 fs/io_uring.o' generates sparse warning: CHECK fs/io_uring.c fs/io_uring.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, i nclude/trace/events/io_uring.h): ./include/trace/events/io_uring.h:488:1: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] op_flags got restricted __kernel_rwf_t const [usertype] rw_flags This happen on cast of sqe->rw_flags which is defined as __kernel_rwf_t, this type is bitwise and requires __force attribute for any casts. However rw_flags is a member of the union, and its access can be safely replaced by using of its neighbours, so let's use poll32_events to fix the sparse warning. Signed-off-by: Vasily Averin --- v3: 1) fix only hunk in TRACE_EVENT(io_uring_req_failed), rest ones was fixed by Christoph Hellwig already. 2) updated patch description v2: updated according to comments by Christoph Hellwig --- include/trace/events/io_uring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/io_uring.h b/include/trace/events/io_uring.h index 80d2588a090c..6ba87a290a24 100644 --- a/include/trace/events/io_uring.h +++ b/include/trace/events/io_uring.h @@ -520,7 +520,7 @@ TRACE_EVENT(io_uring_req_failed, __entry->off = sqe->off; __entry->addr = sqe->addr; __entry->len = sqe->len; - __entry->op_flags = sqe->rw_flags; + __entry->op_flags = sqe->poll32_events; __entry->buf_index = sqe->buf_index; __entry->personality = sqe->personality; __entry->file_index = sqe->file_index; -- 2.31.1