Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3443506pxk; Mon, 28 Sep 2020 18:39:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkQPj6EV0oWKJT7TaHySc8tJoAhgVP5h7XsTetz5gFvda8Oaq0k6bqHPHTRPTia2zskLgX X-Received: by 2002:a50:d94d:: with SMTP id u13mr753723edj.365.1601343583013; Mon, 28 Sep 2020 18:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601343583; cv=none; d=google.com; s=arc-20160816; b=NlFNQx+YDBq5K78SQJ1X7zWW5wjB2YQDpQyMVUSEZkEUNXZuAd50bvd814Vn40ogFV TOaKvwXMG1JJ9kQBOcxti+nYXAvDcIM3M0Et2+m1ekn9+5oL5M6hQzv/CulXNmZWA6Sg ljYSmAkZaS8UXLysPlzDfEAdp3Y+Op5trQDyFQi7PgWeXqwl/vAU9r9hbHFWwkoqE518 odDqUoHk9VNcWnG7gIB/iH576uTdU/RCaGM4fB158rE29B9elI41yGpiyT8n8NbHpy1X XS+ClzHJdnqVQxD/eQQLS+gcnqQdWhroA142odiAHmrJvbEtmCoBBQ6hnNyoTS1E9uAS ku6A== 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 :dkim-signature; bh=2w6Z9ZGACHmXeqUDexwCiIvx94tp1JkUWjT5IcqPgPM=; b=MNc7IyqTxPV7ixo+eGTajrWt6CkJsPOsJ4ezKsxpIrQn9hDdeZ5Z9z9DVS4QX+P6TM SGNPHhBDVsdJJdqoCHjXGpOmx/1G9fmLwKsvcwZCPJ13xpqe73ug6AUfllcQNBnAALDS 3DJDMQKpQNKt+wVk57EiKskprSiUy+Xh+U0H9HvfU+zAtsZH8gLzik3fKgeLjC5ZzRrC CUl8MWPS4i/Ky65bM/n7phhwIC95idG/+TFCk2WT9NQvPlLDvg7aduNV355LC7iAW6Df Iq9yqyfZbqzHBENK97myAbQYSOutAtzABKPKO58cB0ZQ9HR+IdTzSBwc3CQG9/pt3b+r HkEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HP2gxXST; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx24si1644797ejb.89.2020.09.28.18.39.12; Mon, 28 Sep 2020 18:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HP2gxXST; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbgI2Bf5 (ORCPT + 99 others); Mon, 28 Sep 2020 21:35:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:40002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727449AbgI2Ba4 (ORCPT ); Mon, 28 Sep 2020 21:30:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D716216C4; Tue, 29 Sep 2020 01:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601343055; bh=hjeLJcU4y+D2UPaE6PdGfXAU95Pq1CLWddqqvWCNuNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HP2gxXSTqo7d/1KuVWEez/au5qMfDTuvDULmCc4RA45D0djSPANYJDQGqQ9bBj41c ZLDKPaIa607XZ+apVhw1E0XaGLF1vx3750AVC3TcN21YUzwYQ9tEkArsLBl6wA0fkY Q7ObTAbmn/Q09dJ9nUkyQXJgwZkniWgwwpzLkI30= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jens Axboe , Sasha Levin , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org Subject: [PATCH AUTOSEL 5.8 22/29] io_uring: mark statx/files_update/epoll_ctl as non-SQPOLL Date: Mon, 28 Sep 2020 21:30:19 -0400 Message-Id: <20200929013027.2406344-22-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200929013027.2406344-1-sashal@kernel.org> References: <20200929013027.2406344-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jens Axboe [ Upstream commit 6ca56f845955e325033758f90a2cffe150f31bc8 ] These will naturally fail when attempted through SQPOLL, but either with -EFAULT or -EBADF. Make it explicit that these are not workable through SQPOLL and return -EINVAL, just like other ops that need to use ->files. Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index d05023ca74bdc..25543fdec5904 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3316,7 +3316,7 @@ static int io_epoll_ctl_prep(struct io_kiocb *req, #if defined(CONFIG_EPOLL) if (sqe->ioprio || sqe->buf_index) return -EINVAL; - if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) + if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL | IORING_SETUP_SQPOLL))) return -EINVAL; req->epoll.epfd = READ_ONCE(sqe->fd); @@ -3433,7 +3433,7 @@ static int io_fadvise(struct io_kiocb *req, bool force_nonblock) static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { - if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) + if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL | IORING_SETUP_SQPOLL))) return -EINVAL; if (sqe->ioprio || sqe->buf_index) return -EINVAL; @@ -5038,6 +5038,8 @@ static int io_async_cancel(struct io_kiocb *req) static int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { + if (unlikely(req->ctx->flags & IORING_SETUP_SQPOLL)) + return -EINVAL; if (unlikely(req->flags & (REQ_F_FIXED_FILE | REQ_F_BUFFER_SELECT))) return -EINVAL; if (sqe->ioprio || sqe->rw_flags) -- 2.25.1