Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1483850rdb; Wed, 6 Dec 2023 23:32:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXs9LPXSczhbVnD6pQf8JLUb7diWYCAiOIpOMGwoeWd262+bVdYurjaGv7BS2oJmoCGXxH X-Received: by 2002:a05:6a20:a39c:b0:18f:97c:8240 with SMTP id w28-20020a056a20a39c00b0018f097c8240mr1557843pzk.74.1701934366799; Wed, 06 Dec 2023 23:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701934366; cv=none; d=google.com; s=arc-20160816; b=dvBrSOKV6VeaKTJb2368AEeN84mD4iiB0lBkLJRPlNQTg3P53hu3PdXQ/ZA0EDtuyj 4zKe91FX558WmvV0E+dMDbYL0Z3UC9/h87BJo+pnef1IAMH6RUKbyMErvJZd31KpYRb4 G2vbtN7lXhhnxThG229+96ETbFaCFfRl4nEqg9XC7kFGGPOOyKYbMPkfZBSkEf8WKFpL nKnBmRHfKbFPZZ5E2HPBFQ9L+Xq6CDJk7wlBYtVP/VWXH67MRKJAcUy/dsmJjjpt3VpE eqAgwPNwIsGMxjjWV+CuoNU2S2rN9XAQxMMznlYMxui+nqCPFq0IbKwkdjt4YBaVQHBq /Y0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=2JBg1KWI/lODNaatob2ZRU9kl3lhgQ/fOJLCCsogKcA=; fh=FEWdxqeUmdxyYeaNc8q5AkqrBBsbMgeU3zjD18Nhobo=; b=xOJg5cbJ8ZNyDB8MBsNv06mPX3zZVgMBmh2+fdpOnE3oTkmga3/6yKXFGkcPngEmeP EsG6kZfVOgD+s3RVIcQmbV0dMdao15bfj//B3COMbLTWDH/wF8SOOQQqA7aLSc8iVvfH XisGNN6/d+EHLLlOuVaFi/kMvEF+DsM6ITCK37fm2m6cOXef35WAWYOOdHXGrP6AlHiy UwsRL+Rcc9VuOpuxSA7bJ6o7foXbQ3V8NZP2VzwOYR/feSU/JSbSLwbwPKNNDEcaii32 sEStmJfGJLbhx/i37e4LHyhwX2NP+9P4V5rwa+ci9GJjQ92cwgE37XmNuElhqlCFaIFN BDlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-331-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h14-20020a63c00e000000b005c621f7280csi729340pgg.466.2023.12.06.23.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:32:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-331-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9AC0D2831C2 for ; Thu, 7 Dec 2023 07:32:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E85D199AF; Thu, 7 Dec 2023 07:32:40 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5FBF137; Wed, 6 Dec 2023 23:32:36 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id B952F227A87; Thu, 7 Dec 2023 08:32:32 +0100 (CET) Date: Thu, 7 Dec 2023 08:32:32 +0100 From: Christoph Hellwig To: Theodore Ts'o Cc: Dave Chinner , hch@lst.de, Christian Brauner , "Darrick J. Wong" , Jan Kara , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] [RFC] iomap: Use FUA for pure data O_DSYNC DIO writes Message-ID: <20231207073232.GA18798@lst.de> References: <20180301014144.28892-1-david@fromorbit.com> <20231207065046.GA9663@mit.edu> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207065046.GA9663@mit.edu> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Dec 07, 2023 at 01:50:46AM -0500, Theodore Ts'o wrote: > Today, ext4 does use iomap for DIO, but an experiment seems to > indicate that something hasn't been wired up to enable FUA for O_DSYNC > writes. I've looked at fs/iomap/direct-io.c and it wasn't immediately > obvious what I need to add to enable this feature. > > I was wondering if you could me some quick hints about what and where > I should be looking? There isn't really anything strange going on. First your device needs to support it. For NVMe the feature is mandatory, but we still disable it globally for SATA, and second you need to remember FUA only makes sense for O_DSYNC-style writes, not O_SYNC that also writes out the inode. Then you need to make sure neither IOMAP_F_SHARED nor IOMAP_F_DIRTY is set on the iomap. IOMAP_F_SHARED is never set by ext4, so if none of the above is the culprit I'd loke into if IOMAP_F_DIRTY and up beeing set for your test I/O.