Message ID | 20230911103407.1393149-6-leitao@debian.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bf16:0:b0:3f4:cb6f:45e2 with SMTP id bk22csp15552vqb; Mon, 11 Sep 2023 13:57:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhs8g3n3ORCKN7p6ofiwd4R1jZEQ1laOETn4v0pcut93VF5nUwdvyae2Y8VhVbIf2+uYoe X-Received: by 2002:a17:902:9a42:b0:1c3:6e38:3943 with SMTP id x2-20020a1709029a4200b001c36e383943mr8235756plv.56.1694465853184; Mon, 11 Sep 2023 13:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694465853; cv=none; d=google.com; s=arc-20160816; b=aFi/sEg57ZWcHKRyN6RaNBXxtQokltDawfN1p68sJc8gFIyaYNwovl8cHwGqzkZXOm DuPekjsLG81+Fo6hU0uFrGwb8wVRgPQbZnkRJFXyFp4qybPASV8EfgUne3uLcHDsRbnT 4bNlSy8uJgBedH0rwot4woe7/0/tlroEccylBm5sKJM2T2sz3Kl80GCJD+Ey3vM76YxW Oq/k+DxNmRxPVmIyIb417Ftxiz26JtoVRhdJDaWiq2WV1wWsEdN98UueZ0KXVXTQsgx3 ju8+HDwg01qYoHOU2a2kiHvzePRvGxmFXlUigxhdtCagNQaiDMbpEvkNjNtq1GUU22RA dHvw== 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=CCQEu/ILqoq7skisc09M8SCm5EUq/HC3ZQfY+FZ+QRY=; fh=MOKrsmM1ARKzuWu5sqYicQNV1JqmXT2kr5gY0NYg2nQ=; b=HRvAU9k8mGjAxccuN9Tn1iRjD43qWObXxHdku5xIpxYg4uISBKHUy9ofDnvtY9Rt8m Hx/watj5OQn7kEJfstiXj9m5jdvyNuZs2/vTOt/hRZ3Zyjkbt+5QjExHPiwB66qjSiht AgutAJt5xGGXClTQjNzmbPNVu0QtRWzhUjoxGwe1CekYE/UaY7qzSIi1aarozzSbemIx j6akS28AVpjFMM9B0DZWR3Bh/Zrc5tu+Yg/4ukBBNC+0AMLd7m3AND7TtIBLNTe1eWLT F2BVf1lwWWeN3VQnvtr0I1/clWkrLTK8dttTMszTpN8J6m/dDGMuVabrYO9SJqz/LEfQ vuJw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a170902e15200b001bbb39c68b2si6771540pla.178.2023.09.11.13.56.22; Mon, 11 Sep 2023 13:57:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238715AbjIKUzU (ORCPT <rfc822;ryankav.dev@gmail.com> + 99 others); Mon, 11 Sep 2023 16:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236414AbjIKKep (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 11 Sep 2023 06:34:45 -0400 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26C7EE5F; Mon, 11 Sep 2023 03:34:41 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2bb9a063f26so72589331fa.2; Mon, 11 Sep 2023 03:34:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694428479; x=1695033279; 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=CCQEu/ILqoq7skisc09M8SCm5EUq/HC3ZQfY+FZ+QRY=; b=RIZHRvPIMnqDZyF2bfa2HpIYt0H0q6LPJd8I+nY4iE9CSsGeMSxO159HycFDPerDn8 3Nna0KTL1tNnxfJMekW77jMDey9z4p2Zvy2864q2e/1yFqm2wKwb1eHVwxqy0KFZomlZ XqAqGrgdfA6MOeo2zUeiXeXDOmDGeofHsH6geQ+awE1Hbfi10b7tggi0vXQ6ZkjE2b8O qxGxjOdcwTlrzh+eat4zl1uCC90+mSsmEKLx2gyN5DFa1llrj6ySogjo36C2XJjXgyBQ 1wKTz0qI7WmHQ40QMooa61FTyvBRVYo7JdtsqGBWpAxO6P0FM2lMKPgI3+7EaqRusXQF tz3A== X-Gm-Message-State: AOJu0Yxrii0gFRZxsDQu/Jy2rkM60zBroGy5Azk+Ij/+ZMxBELyLNiDJ bQ36Q8i9pXctD21QJuG84Mo= X-Received: by 2002:a2e:3609:0:b0:2bc:d993:bdaa with SMTP id d9-20020a2e3609000000b002bcd993bdaamr8173814lja.18.1694428479114; Mon, 11 Sep 2023 03:34:39 -0700 (PDT) Received: from localhost (fwdproxy-cln-011.fbsv.net. [2a03:2880:31ff:b::face:b00c]) by smtp.gmail.com with ESMTPSA id o6-20020a17090611c600b0099cf9bf4c98sm5192137eja.8.2023.09.11.03.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 03:34:38 -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, 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, pabeni@redhat.com Subject: [PATCH v5 5/8] io_uring/cmd: return -EOPNOTSUPP if net is disabled Date: Mon, 11 Sep 2023 03:34:04 -0700 Message-Id: <20230911103407.1393149-6-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911103407.1393149-1-leitao@debian.org> References: <20230911103407.1393149-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776776226686029367 X-GMAIL-MSGID: 1776776226686029367 |
Series |
io_uring: Initial support for {s,g}etsockopt commands
|
|
Commit Message
Breno Leitao
Sept. 11, 2023, 10:34 a.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 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 60f843a357e0..a7d6a7d112b7 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -167,6 +167,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; @@ -193,3 +194,10 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) } } EXPORT_SYMBOL_GPL(io_uring_cmd_sock); +#else +int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) +{ + return -EOPNOTSUPP; +} +#endif +