Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp225381pxb; Thu, 7 Apr 2022 04:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyofGqOPfp29I4NCAoi0/UyR6JfVEWpcyEB0gaC/x2LsszHfpCGuApY1pQ9XwmJtgyT0YX3 X-Received: by 2002:a17:906:2b93:b0:6cf:bb48:5a80 with SMTP id m19-20020a1709062b9300b006cfbb485a80mr12618751ejg.681.1649329613638; Thu, 07 Apr 2022 04:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649329613; cv=none; d=google.com; s=arc-20160816; b=06ipTM1GAlUjcrOj2CxzULERZMxv/d6TIxaSc7o/iN0VOjEAYQwaab/xmtk/pNjuGE agw1uWkW+rhMVAhe46mfohzNS+yJ3aHsp0YOSn4lSXqjqbsSL+9gB0cdZVW0cNx1YNoG jnEbTrbbnuf5QDwe1CkAWyf9j8dl3NVSGzbyhPif2V3lJJeY1RZmUMVmYg36rrGA5kUA 6PAnEPB33JNui9hYvmkbZ+c/ghmcUcPPqaALmvDht69g5Uf5azFkiEP5X7c/smrYtTCZ 1wy4f1pcjGkDUovxmYlPvsN8Ywd4ydLRyCvlpIuC4zv2fEfjDKoNSSPB0lhQ7a1WojnR /4wQ== 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:cc:to:from :subject:organization:dkim-signature; bh=tjE4F+VkZbv2xmdpOvOgBYvqlE4FJMvnbAyHbXfLmlo=; b=HZLyUu9M5I9qBgvbhvWVd8T9E+Ng4cL634+2/JVOvxhzZ5zspVmPHVVFGjk3kUCewS tYTNkNV5A5aeNpHH5VWmUUt4G6GsZZNLgfdDclYCO1cXm2eKEqtPVFSSe7buAvggxcXy TCp5GCZw/KfSWQqgu7ba54G1ZYEw1TteWi6l5CsWW9CwMGulzc3MIrx22nEES/UZaLRt xVqGXJ1Q3u1ZLTevkEF4kh6ACSCJhe/KGYGAqJjV7p1s5kOgoYLu8RCHHqHtsyfLOHMJ zA9tquKYS5xL4kG2I9NzeHUHzZFdUxNPgLu83lf2B+ACUkLK0ZDY96y0ekfdnlMeIAhx RjNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="b0Avp/tt"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020aa7d64b000000b0041cd326c03dsi1850372edr.619.2022.04.07.04.06.22; Thu, 07 Apr 2022 04:06:53 -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=@redhat.com header.s=mimecast20190719 header.b="b0Avp/tt"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237576AbiDFXFd (ORCPT + 99 others); Wed, 6 Apr 2022 19:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237549AbiDFXFZ (ORCPT ); Wed, 6 Apr 2022 19:05:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAB0C11CF49 for ; Wed, 6 Apr 2022 16:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649286201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tjE4F+VkZbv2xmdpOvOgBYvqlE4FJMvnbAyHbXfLmlo=; b=b0Avp/ttedeitwn3fWeuVkB8SeEaRe8Raul9xlPoieW4dlj6MReeONDSDzPb1gr5VNkgFP sUGpzlOxTedWCltPesvBb4RJ5+qMDBIKTsRljxAgJt2AcfyTLi8uuuDOWQMQvHzCSlnKzi ZF7YMIOf0271xF8gebihTrFsZgAkwc4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-DebMNWulMx2-tzQ-BHbpNQ-1; Wed, 06 Apr 2022 19:03:17 -0400 X-MC-Unique: DebMNWulMx2-tzQ-BHbpNQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7481A1C0692D; Wed, 6 Apr 2022 23:03:16 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30A48C28102; Wed, 6 Apr 2022 23:03:15 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 03/14] cifs: Check the IOCB_DIRECT flag, not O_DIRECT From: David Howells To: linux-cachefs@redhat.com Cc: Steve French , Shyam Prasad N , Rohith Surabattula , linux-cifs@vger.kernel.org, dhowells@redhat.com, Steve French , Shyam Prasad N , Rohith Surabattula , Jeff Layton , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Thu, 07 Apr 2022 00:03:14 +0100 Message-ID: <164928619447.457102.6541196459943955179.stgit@warthog.procyon.org.uk> In-Reply-To: <164928615045.457102.10607899252434268982.stgit@warthog.procyon.org.uk> References: <164928615045.457102.10607899252434268982.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 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 --- 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 a47fa44b6d52..fb60b5410789 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -944,7 +944,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);