Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp470756rwb; Wed, 16 Nov 2022 03:29:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf56P4dWDfTXwYEBbX1FQfCaXaP5pmwy47oKXLWyMUU51a5b6doTyPRnki41vONdP87WDsEw X-Received: by 2002:aa7:d386:0:b0:463:ca19:6cdf with SMTP id x6-20020aa7d386000000b00463ca196cdfmr19228661edq.379.1668598156292; Wed, 16 Nov 2022 03:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668598156; cv=none; d=google.com; s=arc-20160816; b=SCgBYK07KmuZqCpl9wvf4BMLX2WhIulsvcEnhkJIPhmwkrvy1K5vbOf3PMLvXHvRpi f/FqbX607EBpORztgRfE5bt8Zjv5eZ2y7RT4a+udMM6w3SW7570zVLpOlhW8YzGgM3ct VB+RCKaiVPwCCnoztdNpIlEgJxSgaPcT+yEp5Hf7VXtwz/OBDRROpY2xAgEHa8VNmhl/ 8cYqqRC4V9lXv4zOgYX5r8PXjtgYVkLGLCKhg48hvdB0SfN2T/e1zh81VmiBFCgFGxlW Mxjw7+dDQumQar5WK6cggT8T1cYcx+r+PrNO/41RBJqhSSxeF8+1dff7TEm+sk4x8uUG lH3g== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=YenR20KS7/ku52hVhZ/YTr/CZ9ObYykmH5WR9y49LoA=; b=e0/MHDM2zRqETNwQfKwSBLP7UPh3l5gkfddz/rBme0a5IkywgOd/PXgo53UmUeIFV9 pYwCXCaD3LutxMQta+K06CtRCkHA/nLH3CQM3fArhncXnYYHpdqzBGkN9evTWuBcEbN4 O3BWOxwdW4paDXEobVeu+YXCpYwnCZxCVmJvkvoyxQGY4CobG+QhzZFMmolcsq6fUZyG MTUCShiYjIpfjGQNyvDp4TFWBZBWgN/w1XvavEOqsyfsyc/jxIcSw7Y6vpEOAFEB5SOR LuzpFn2k3f1zV//5EhVIaBhF456WdGi2aPjX6tLfdl/2t+dGiXP2XleCdXf+ig4Na3kz tEIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b="trQ9/M+3"; 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=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170906644700b0073d9ea386d4si9965196ejn.983.2022.11.16.03.28.54; Wed, 16 Nov 2022 03:29:16 -0800 (PST) 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=@gnuweeb.org header.s=default header.b="trQ9/M+3"; 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=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233169AbiKPKjO (ORCPT + 91 others); Wed, 16 Nov 2022 05:39:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233729AbiKPKhF (ORCPT ); Wed, 16 Nov 2022 05:37:05 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEC3F248C4; Wed, 16 Nov 2022 02:29:04 -0800 (PST) Received: from [10.7.7.5] (unknown [182.253.183.240]) by gnuweeb.org (Postfix) with ESMTPSA id DF66781608; Wed, 16 Nov 2022 10:29:01 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1668594544; bh=kv9K+eAhAgOOw0umGQi03iVhUmWyfNCkW9m4Mftth3g=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=trQ9/M+3ji+3a/I+q60BkllYOjDYTF9KUHB879BeU/UdHMv27SKOgecsxicPh2qMW AqCPYREloFoWHfrdNc7rXVz5K50OtbtOIY2iG+Xu2+rN0+lshWVf/wgraPoBLGwYa+ vVoMKEhhgJExkiVpW4/0QYhkvdMqDW+N/zdr2Kq/bowPsRn3CTAFLna5O5nyYC/34J BtEeNtxJaaP64WmIT/uQf8vPhctUFncFCMFHgmUHApiF3pnPshb7MW8Rof1AH2mmE3 eV10CZzp0P5JBK3TH/4l9nC7JFIqRIyjNPqoS3gPSKWiS3W6IXiWtkDvzzVSU8koW6 Li+rtFiU2VnuQ== Message-ID: Date: Wed, 16 Nov 2022 17:28:58 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: Pavel Begunkov , Jens Axboe Cc: Stefan Metzmacher , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List References: <20221115212614.1308132-1-ammar.faizi@intel.com> <20221115212614.1308132-3-ammar.faizi@intel.com> <63a47e31-6d30-6dad-7b8d-1f14a7bd8fd5@gmail.com> From: Ammar Faizi Subject: Re: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array In-Reply-To: <63a47e31-6d30-6dad-7b8d-1f14a7bd8fd5@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS 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 11/16/22 5:14 PM, Pavel Begunkov wrote: > On 11/15/22 21:29, Ammar Faizi wrote: >> From: Ammar Faizi >> >> Don't use a zero-size array because it doesn't allow the user to >> compile an app that uses liburing with the `-pedantic-errors` flag: > > Ammar, I'd strongly encourage you to at least compile your > patches or even better actually test them. There is an explicit > BUILD_BUG_ON() violated by this change. Oh yeah, I didn't realize that. This patch breaks this assertion: BUILD_BUG_ON failed: sizeof_field(struct io_uring_sqe, cmd) != 0 This assertion wants the size of cmd[] to be zero. Which is obviously violated in this patch. I only tested a liburing app that uses this header and validated that the struct size is the same, but not its field. That's my mistake. I'm *not* going to send a v2 per Jens' comment. -- Ammar Faizi