Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3896533ioa; Tue, 26 Apr 2022 11:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxneYtP7wDW1QYGhWm+Sk/YMXF/8fJEBrh+Y0bLKN8++cFsEj0/3ocFo6T1wTlrmfzzDvlr X-Received: by 2002:a05:6a00:1a0e:b0:50c:f9b5:6c74 with SMTP id g14-20020a056a001a0e00b0050cf9b56c74mr21385856pfv.69.1650999257196; Tue, 26 Apr 2022 11:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650999257; cv=none; d=google.com; s=arc-20160816; b=Xs68ZsD5o3uauSGYzAoGqGDo4TosFjQ6sq1NDCwfxhdq6+HSYddwcpEC8TtEz+SaJs i4h7H7k5QXg/1fOpsUkHaNLahweOah35u8DHs1NL8SU8jjyY6jAImLrPMug6l+ZD9hBI Cn/3hKkF7Q3dKLi6Mr0zROeOvaoSh0/lvV+HyjK6Sp1evEN60jDRLirPbfTGqGqT6Iy1 fgUiD29b5YL+js117dBdN7PoAS/++YyHTDC9R7k8jPwKD2XV3jiRsLzPlzN1fJJ/8zrM K3xNUeqpYGTmSW+EIUnCRIwx1oba9SFWurRpfjvPhCNO/VO9v6NbPypbVOpeIiFsyK9k 91nA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rquSuM6fkq7hzOJP+7twvRECW1Z4f1m1ZHt4DiHvS3c=; b=RNvj9ORNIG6kQFUdGfbjWLC+70rSWRxrSH0t5IMjIJASNQYf0gpEeVd6Us4h03CW0Q NWh+9+WSzwNExjEzpb4xNco80h4ubMsHo1sAAJC7KJRJNJWW1sj290J7B7NKLPiowFoc woyJEk5EjAFApxeo7gvKKGF8r7m07JxNG8GaGNVUKORET0cDv5sQPXnXGsTaUSNwYVgP yF5dJbLDFy6Ij0fvX37luXvaIwpj7yZUeApxqFMFygkvElUZqbf4v6CKxMVcRrc3sSfi aOa8JaV7n0zHOtwQxwTKj7bAjDgbRz68xI6Y5AhPuWoDdaU8SEszxZQMj+dPl0Viq5Xk hjVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W1lR9YQi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a656402000000b003aa6ef17735si2822043pgv.215.2022.04.26.11.54.01; Tue, 26 Apr 2022 11:54:17 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W1lR9YQi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347339AbiDZJKl (ORCPT + 99 others); Tue, 26 Apr 2022 05:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346767AbiDZIuU (ORCPT ); Tue, 26 Apr 2022 04:50:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D33AE1569E0; Tue, 26 Apr 2022 01:38:56 -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 A6B04B81D19; Tue, 26 Apr 2022 08:38:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3665C385A4; Tue, 26 Apr 2022 08:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962334; bh=g9ikFThTprFXEbpMfX/pPV5aTGQ0cE4Xy7li5Qy7Jpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W1lR9YQiic5FehvxOmVaFWs8nXMP3L6pF8kidpov1tPNDoA7z2Abj81MEtxsOT6oh fQGvYhefikbYWSbpQpx4O/ErQEkd7/muHsCO3asUDpGf9SfENkLvOVGNGSSg4IUJhg cnT4UXhy35TycuUxheBxsiBLPAOX2KVN5KOT8wGQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Steve French , Shyam Prasad N , Rohith Surabattula , linux-cifs@vger.kernel.org, Steve French , Sasha Levin Subject: [PATCH 5.15 061/124] cifs: Check the IOCB_DIRECT flag, not O_DIRECT Date: Tue, 26 Apr 2022 10:21:02 +0200 Message-Id: <20220426081749.035966546@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit 994fd530a512597ffcd713b0f6d5bc916c5698f0 ] Use the IOCB_DIRECT indicator flag on the I/O context rather than checking to see if the file was opened O_DIRECT. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 29a019cf1d5f..8f8d281e3151 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -936,7 +936,7 @@ cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter) ssize_t rc; struct inode *inode = file_inode(iocb->ki_filp); - if (iocb->ki_filp->f_flags & O_DIRECT) + if (iocb->ki_flags & IOCB_DIRECT) return cifs_user_readv(iocb, iter); rc = cifs_revalidate_mapping(inode); -- 2.35.1