Message ID | 20231016134750.1381153-9-leitao@debian.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3483701vqb; Mon, 16 Oct 2023 07:04:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUe6sZQ8mKK6Ry8plx+AktjjBIrPLnEBQaTgmyV51R8FVt+XJ0auRhzQ2VpnSaf/Q8weZT X-Received: by 2002:a17:902:e042:b0:1ca:1ce1:bfac with SMTP id x2-20020a170902e04200b001ca1ce1bfacmr7707624plx.1.1697465078880; Mon, 16 Oct 2023 07:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697465078; cv=none; d=google.com; s=arc-20160816; b=GKT97YMd+GhgpotYrVtIO85VUumB7utvgECaf+6ejRoxKdn79RwVV/TjWA2enHYM2p bDtL4yXZ9T7YiZl810JLvZkE5dj/0woBV6qMDW1rXnraORiX7W0egzUNdq2g6hzxdZCz YfSaLtKxTiWInIK5fSBYhd12yJPv7ZPeh1rGSb5W6bi8qpQ5+CSvixPOm4//hif+dPRL ZHtt4CuQBTnEoPtMUW6SnYQkhWSj5bAPGbAgdPDaktOj34ohLEGyvUbwzzfBN2QqKXta Cyx/VXGnsn3HZWjaAyN231AnPWqD9kM0DD7OG2D51AY/YWfWEXBoLiPo7dCljbE8hUnJ 4T+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=J+1IratzCwRElqGveWEFhyqeH/oYCw38flsead1Kukk=; fh=U2H3/FPocPBB6GPezKHW9HS+wZ8AoMiBoUwvb1zfBQs=; b=YsvnA3KA5BMYp6IFmgU5T03W0XOAui0S1ztRbnE7GtG9EhQMVhHW9EgC2W6dbTKxk6 Da+0rj5BD3mvuYJVr/9zPKm5ekXi6Z9mHDuc0TpxwJUAnjNAQfA1EvULeBMETKc36IdX oA0qWi4KZplAv7i1oMEyk7dtgYPu9gKim6/boWRl/TeU9r+WzmCqw7ekzhY5SUPmKqMn yiz7ax7G0NajQRcTtGQOoZvNINrwzrzOHB6lI96yNldsEAkakpr4cb1Hk4lpxE1C6r5y PXkk08zER4eeHYqX5qRlZ+5De9qTh6eBxoY7vz/MSwUQuekxVLIV8BqFEkFV59Wyq+ek VC2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k17-20020a170902c41100b001bbfbe6bf3esi12034531plk.504.2023.10.16.07.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 07:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BFBE08072A1D; Mon, 16 Oct 2023 07:04:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbjJPOCq (ORCPT <rfc822;hjfbswb@gmail.com> + 18 others); Mon, 16 Oct 2023 10:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233805AbjJPOCN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 16 Oct 2023 10:02:13 -0400 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A68FA; Mon, 16 Oct 2023 07:02:07 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-9a58dbd5daeso738058566b.2; Mon, 16 Oct 2023 07:02:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697464926; x=1698069726; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J+1IratzCwRElqGveWEFhyqeH/oYCw38flsead1Kukk=; b=odDokHQE8P3E56FUu42jksy1Av+ieE2a5YsXEPWdEfrvsUuECO6AEFHt/MYSpIGS/8 WhAx7yPgdZG2M7OgvKC4d3GBXgHl1ydlDnNKsJIvpN9nTgJ3C2L1aPUZYxpbGBH+pPQH 2ORS9iRAW5hIC0rHMiXvhylhDlh2pFfORu4/Q8eTpjHGncwrHUZQlQcpZG2KuYA8mU5s pF5GmTD43sEhy946ihSEmjauGL2a9r10rNUAN14JXLoQx/lxLh8UHt7XF1corsBKmerz 8i1Bm2Y7MGWAvOc80zZOt+5niJVXCPTexTTs0W3Uj+7EyTNbNsXH1cep53gsWFXhuT6H oI4Q== X-Gm-Message-State: AOJu0Yzotkr0i+58a9kykLK9Ea5Vl+Wu0Uf5J7sZ/7AhwQi21Ry8+BRL /69tHX/Ym1Zm18LArKrkgTc= X-Received: by 2002:a17:907:d24:b0:9bf:697b:8f44 with SMTP id gn36-20020a1709070d2400b009bf697b8f44mr5817823ejc.6.1697464924186; Mon, 16 Oct 2023 07:02:04 -0700 (PDT) Received: from localhost (fwdproxy-cln-017.fbsv.net. [2a03:2880:31ff:11::face:b00c]) by smtp.gmail.com with ESMTPSA id jz28-20020a17090775fc00b009ae57888718sm3997303ejc.207.2023.10.16.07.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 07:02:03 -0700 (PDT) From: Breno Leitao <leitao@debian.org> To: sdf@google.com, axboe@kernel.dk, asml.silence@gmail.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org, pabeni@redhat.com, martin.lau@linux.dev, krisman@suse.de Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, io-uring@vger.kernel.org Subject: [PATCH v7 08/11] io_uring/cmd: return -EOPNOTSUPP if net is disabled Date: Mon, 16 Oct 2023 06:47:46 -0700 Message-Id: <20231016134750.1381153-9-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016134750.1381153-1-leitao@debian.org> References: <20231016134750.1381153-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 07:04:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779921142514150185 X-GMAIL-MSGID: 1779921142514150185 |
Series |
io_uring: Initial support for {s,g}etsockopt commands
|
|
Commit Message
Breno Leitao
Oct. 16, 2023, 1:47 p.m. UTC
Protect io_uring_cmd_sock() to be called if CONFIG_NET is not set. If
network is not enabled, but io_uring is, then we want to return
-EOPNOTSUPP for any possible socket operation.
This is helpful because io_uring_cmd_sock() can now call functions that
only exits if CONFIG_NET is enabled without having #ifdef CONFIG_NET
inside the function itself.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
io_uring/uring_cmd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 4bedd633c08c..42694c07d8fd 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -214,6 +214,7 @@ int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, } EXPORT_SYMBOL_GPL(io_uring_cmd_import_fixed); +#if defined(CONFIG_NET) int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) { struct socket *sock = cmd->file->private_data; @@ -240,3 +241,4 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) } } EXPORT_SYMBOL_GPL(io_uring_cmd_sock); +#endif