Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3510458rwb; Mon, 16 Jan 2023 08:57:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8rtg0K5z4pX9oc6IdCQM82RC3DOngEe9UCqzrNOiO1RbIxLOpLno2zN2I5m5a6svp6ZLR X-Received: by 2002:a05:6a21:3a41:b0:b8:a0e1:274b with SMTP id zu1-20020a056a213a4100b000b8a0e1274bmr2474775pzb.4.1673888255284; Mon, 16 Jan 2023 08:57:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673888255; cv=none; d=google.com; s=arc-20160816; b=FUQwKLY0cWzxgD9qQ/0131K+Eo8krz6Mios1EJH++LK38xlAwZ+ZF6nQywwA7khbvC tDs8XeiaedQXwGccZSWJ9jlFoSMa19QHM8xXrNJWUAvyGEamfxG426FqLNX6uBcxSb/h 1Y0AvPPKoo5y10ovRrhdZpI9Yn39AalUBRA3GQdPpig6Q+fISmhZTyFw+OFq5F6gNhKY VsqzCB0+1OaeNyE7ezKDMTkaGHiSOE6QvipBCNyLLUpwlKPTYX4ni/qBBbFNWoslK6Py g3JZoxctuxCjdCCRZl5UlYxERgmBJpU4Yo2iznetY9EyCM5m5ZGv9CcMmoVAjUzFGoWO K35Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=S9gM8x3cA80HqU3e2luPT3SBWdSZm60Sxg3tlhcnbas=; b=QwElllv3eQr7fl++yZHzVaO1DGZcZSf3J4LQx6BJj16IQOcObkCF2L/XDfPSN9oMX/ X6uZ6mNas9uQN90oYMsRDiPZeJ+Tq9+cxJiyqcikx6MXi5cjXA4nrru2e4W5jm+U8/3J uPvxv4T9JYTf7yyzteJZpmxFSgYYQTsCllXsQHhHnlW+zc6EKJgpTNuZSdgkwkzDSLxO hmirxD7m+vW0lsj3GRmaGC3pU1c9yVPvBxW+rfEt7r6GxKJdApxFy1uoc6VQZ9TgQshw OddxG5DnQBzHhMUKjMnBlccC6Ipf2tzYGHA6RGOP8jWRL+o2ontC+++t77oVdH7J6dKN bBow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="YVvQ/VNm"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a63f056000000b004790756c656si29918938pgj.299.2023.01.16.08.57.28; Mon, 16 Jan 2023 08:57:35 -0800 (PST) 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=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="YVvQ/VNm"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232538AbjAPQKd (ORCPT + 50 others); Mon, 16 Jan 2023 11:10:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232064AbjAPQJ6 (ORCPT ); Mon, 16 Jan 2023 11:09:58 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9E32384A for ; Mon, 16 Jan 2023 08:06:30 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id o7-20020a17090a0a0700b00226c9b82c3aso31478409pjo.3 for ; Mon, 16 Jan 2023 08:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=S9gM8x3cA80HqU3e2luPT3SBWdSZm60Sxg3tlhcnbas=; b=YVvQ/VNmlxI9+70G9+L+xZiF8Yt9U7zV43DBl9Rt9ZB+aiOkNsGX8xmxrxdl4od2I3 23+PVRwUalnF5kxsnwMH6teOhr2HB4Mhv+kex3/o2repuRxP6Vfs3z38VZonsnsEuCQL cWJvQF7JXvJpbUrV/dozhhy9/6HFVpvHDCdXRMbDXE1SbYQB5A6WDl82X6+MSvRCGkDB urJyNNnyo2cXGnxm59yt3r30pnid+dmJNOjAxo383FJTGnILsCTrnq5JRoyEPd2klpMK Io68eE1qrnWlBX92es8RJmKDcOC+twlvIhU0WtXP8yyx0box2wBOSUtXn5Xf/9psurpU tHgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S9gM8x3cA80HqU3e2luPT3SBWdSZm60Sxg3tlhcnbas=; b=LL0WnxmTmSwvdmeZaBpVhF96ushrtau1iofHI0YsHoEXeT6ldcsdBxFQxRZpGfj2rE CLzHJsifqHqtFNCpOYPg9sbMjmQYGUtQyeunANfhag+rajzg6FIEkSQcdA3TNehk1P55 KbPrVjOyX/jAT/ZJ5NbbeGCRy3eghUki2zg8z1+kVcD64m+b11Ae3HCwFMFmZ3bqg7Jh F0cScbkRNQx5uqJ8NgQMjX1x86crZLZsjiTxc5rLcU+k6b3s6zcL6sDIQTCn4i5Jsxse V4Fs2W7vw0br/LWvjLJRvjG/1Mhh8NiFKv2vn01jOwxKyyXbz7PGlPXTl2e07oLMah2F R30A== X-Gm-Message-State: AFqh2krCT/B6m/UqgRrkZENntihfZs7GvDJRDfIty9kqRZsPiJHsA7hJ ZRHmHCQY/OmE3fLjsY9rduuNRw== X-Received: by 2002:a17:902:7041:b0:194:5b98:4342 with SMTP id h1-20020a170902704100b001945b984342mr57781plt.5.1673885189855; Mon, 16 Jan 2023 08:06:29 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id x4-20020a170902ec8400b0017f72a430adsm19677815plg.71.2023.01.16.08.06.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Jan 2023 08:06:29 -0800 (PST) Message-ID: <70e4869e-1ab8-9838-5af8-8cd41a536f2b@kernel.dk> Date: Mon, 16 Jan 2023 09:06:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: Is there a reason why REQ_OP_READ has to be 0? Content-Language: en-US To: Christoph Hellwig , David Howells Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <2117829.1673884910@warthog.procyon.org.uk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 On 1/16/23 9:04?AM, Christoph Hellwig wrote: > On Mon, Jan 16, 2023 at 04:01:50PM +0000, David Howells wrote: >> Hi Jens, Christoph, >> >> Do you know if there's a reason why REQ_OP_READ has to be 0? I'm seeing a >> circumstance where a direct I/O write on a blockdev is BUG'ing in my modified >> iov_iter code because the iterator says it's a source iterator (correct), but >> the bio->bi_opf == REQ_OP_READ (which should be wrong). >> >> I thought I'd move REQ_OP_READ to, say, 4 so that I could try and see if it's >> just undefined but the kernel BUGs and then panics during boot. > > There's all kind of assumptions of that from basically day 1 of > Linux. The most obvious one is in op_is_write, but I'm pretty sure > there are more hidden somewhere. I didn't get this original email... I would not change this frivilously, as Christoph says we've used 0/1 for basic read/write data direction since basically forever. So for all intents and purposes, yes that is basically hardwired. -- Jens Axboe