Message ID | 20230913152744.2333228-6-leitao@debian.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp44276vqi; Wed, 13 Sep 2023 18:27:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0urj7KmNV4F8WxHYnhaxxt2O4RHKlt8TQCk0bSgkzE74G1bpGYQstcSgSCnTy/LGy1orL X-Received: by 2002:a05:6a20:a127:b0:132:f61e:7d41 with SMTP id q39-20020a056a20a12700b00132f61e7d41mr4567642pzk.5.1694654857745; Wed, 13 Sep 2023 18:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694654857; cv=none; d=google.com; s=arc-20160816; b=rESqJ747U8toqMiaNkiCZhnZ2tt5prbeYdm6B/NZIA09CNWfUkwaQDW0ktmll/RxI/ t8jNmQo6ptGZHPFvYlozYlvc2MYONUJA3vTdBjUrpLBf7eXUBpmw4vkhEbliJcal4FJ1 WlhmXXDGnTzjnxFBljshSSvPRCdDO69I/j2syDArc7QrgVuAmSK+cLpYttq1tUp+v2Dr y6UhBaRYFK4itp1JMpnTK33ZGw7hfmcKVajK8ipKNjXTHxmuxk/0wWlUfbLyPqA4ZDIY 5u+rYp9zbT2FHLuscauyWAaQNZEaeoLdzPhCTrmXEQph5TIREnVkIHQ+pSJqeeEf3kO4 2Ihw== 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=rF5iM8ZkJqphGmjRFU1s0SbK7ImZ/Xg4gUBQOimY8QI=; fh=U2H3/FPocPBB6GPezKHW9HS+wZ8AoMiBoUwvb1zfBQs=; b=EwJzlSOBOvWaRMj1f2lXiS7ee2sTE3UBQHCcrZ9aieDixstNh9ZFgypS27MhptUDHL LppQo4Vn9KQDcxmZeftk2rrxOmKQ7G0ELCOqs4rgn6rmNiYOTzUesv44c/8sa9mdllJ8 DbR2NETPu6FVxcjiHV2/oitaoM38ZU+4YG5DvMuuQS/1FbDnRobgQD33BePEnNGl58kw zOih40sMqARTL5SPuWPli50e/xAmw6o4WT44xK35OxjQM7FpDoLiJQN/+qqmxMU8hBbn dt2I9maxp/5RMP2IV1TsDxlgUCXjwcrRB7s4thp5yWEzoQ7X4C9drfuH/xm3xWW2q0Xu aQSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cq6-20020a056a00330600b0068e47f1fc7esi463210pfb.159.2023.09.13.18.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 18:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 67001801D0F6; Wed, 13 Sep 2023 08:28:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbjIMP2t (ORCPT <rfc822;pwkd43@gmail.com> + 35 others); Wed, 13 Sep 2023 11:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjIMP2i (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Sep 2023 11:28:38 -0400 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7BC1BE9; Wed, 13 Sep 2023 08:28:33 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-502b0d23f28so6812681e87.2; Wed, 13 Sep 2023 08:28:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694618912; x=1695223712; 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=rF5iM8ZkJqphGmjRFU1s0SbK7ImZ/Xg4gUBQOimY8QI=; b=i6HhVNKpabsOIC2vJKOGy/osVxXwPvIZ/0kg4nRvpeW7rlqSCb1WtpJvR0lMM09S17 J8HcNioLp2n4DbmP/s0PE+Cx37xLFQnqsGTt1q5oV+0tjQhOUnO2s2g4YpDqr0hcZpVV +wmiSyFHqRk7c/FXKqZ9/7odXustALINmGb73P30w0ZsdZwdZClnRaeqlh045jqSqYNJ P3h8eSIEfmfPOedoXjUZ6fCEau/tQETJjAY2+BgBFCdjibIpPxcTmXIEwWLLfxh9NUfo myMzxPlTF/YHEq1UnJuzKhkuwVGZf/dBtk85RChMXTsJOEiWtS+Lrh8mEBGe+f+W2ELg JcXA== X-Gm-Message-State: AOJu0Yy1OmCJGvkJJiddeQWIz0PrJy5qLdOPyI3QzvaFOlcNkez8eFY5 rEWUHMNu7+aLuEEsWmHwWXQ= X-Received: by 2002:a19:2d08:0:b0:4fe:1681:9378 with SMTP id k8-20020a192d08000000b004fe16819378mr2448500lfj.66.1694618912053; Wed, 13 Sep 2023 08:28:32 -0700 (PDT) Received: from localhost (fwdproxy-cln-001.fbsv.net. [2a03:2880:31ff:1::face:b00c]) by smtp.gmail.com with ESMTPSA id kj27-20020a170907765b00b0099b5a71b0bfsm8705015ejc.94.2023.09.13.08.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 08:28:31 -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 v6 5/8] io_uring/cmd: return -EOPNOTSUPP if net is disabled Date: Wed, 13 Sep 2023 08:27:41 -0700 Message-Id: <20230913152744.2333228-6-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230913152744.2333228-1-leitao@debian.org> References: <20230913152744.2333228-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:28:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776974412375133174 X-GMAIL-MSGID: 1776974412375133174 |
Series |
io_uring: Initial support for {s,g}etsockopt commands
|
|
Commit Message
Breno Leitao
Sept. 13, 2023, 3:27 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 60f843a357e0..5753c3611b74 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,4 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags) } } EXPORT_SYMBOL_GPL(io_uring_cmd_sock); +#endif