From patchwork Tue Apr 12 06:30:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 560614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6102FC46467 for ; Tue, 12 Apr 2022 07:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351125AbiDLHTK (ORCPT ); Tue, 12 Apr 2022 03:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351661AbiDLHMr (ORCPT ); Tue, 12 Apr 2022 03:12:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F98B2982C; Mon, 11 Apr 2022 23:51:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 210D6B81B43; Tue, 12 Apr 2022 06:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CC15C385A6; Tue, 12 Apr 2022 06:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649746262; bh=ZHKV8U6IfPcXIEtDMDsnl9NA2kGDXwtGA+jMYqc6pGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZYcQ+oBJkvvnfiv0pDAKt6BaF4WvbL7kMLFMVK2oZBrBhWjPwRelXt7KX8mavJ26X nbu3s91oPS6DAZG6Vs6e3/P8/rBTq6mq3tGamOX6mVqLN161fbxx1s4cTUmfpPGnWD lWo7lDOCK+n9B0QZatdpJZNOvWzw87CXQnLHiHTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe Subject: [PATCH 5.15 218/277] io_uring: dont check req->file in io_fsync_prep() Date: Tue, 12 Apr 2022 08:30:21 +0200 Message-Id: <20220412062948.349863228@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062942.022903016@linuxfoundation.org> References: <20220412062942.022903016@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jens Axboe commit ec858afda857e361182ceafc3d2ba2b164b8e889 upstream. This is a leftover from the really old days where we weren't able to track and error early if we need a file and it wasn't assigned. Kill the check. Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4128,9 +4128,6 @@ static int io_fsync_prep(struct io_kiocb { struct io_ring_ctx *ctx = req->ctx; - if (!req->file) - return -EBADF; - if (unlikely(ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; if (unlikely(sqe->addr || sqe->ioprio || sqe->buf_index ||