Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp846632pxk; Thu, 3 Sep 2020 14:14:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAgaj0RDSIR9H6l+3ex2Yw/RCcl1UZs/elYrMrPifAOkgd7TczE4WJ+nVv2D1bmse+T5G3 X-Received: by 2002:a17:906:af6a:: with SMTP id os10mr4076280ejb.34.1599167670017; Thu, 03 Sep 2020 14:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599167669; cv=none; d=google.com; s=arc-20160816; b=bYQSbsBLi3P/S6B2dBSavDpYcNQc28aUE9n9gn6pCg1nuAlVxjzap5e40Gz3cZwWCD wLougc233dZryRl+ABWP1PKns+nhu2X61ZxoInaIpQyPA5+mMpAhlwId8zERN5y5ONUw FgtMb52xaAF0bMUOYS6TuvoO55nqIvtldTgc0aFQX+XF4NNu1PyIsGsyz+qWdd5qL/27 /Yda0ukIVS7wQMtyhTsSzbDID27vK+Tb/KWmzyMtFQ6oADjcVE07UB2QczwRIDO0Atc3 XRDB0k0OEmTCaPHygIwI/bC8/sydnV2ZnpnLf3cObQA9EfjSLHb9g0C1poN8YiDfRQnw Tvew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AkNxft9fb/41tgGVF0kA/AeGQiQVi92Q5P2DI3tp/PA=; b=ZICLJppm90+dQp4ZFRqH9V384IsJNV/nwgjRzN3bZzUWGSo6K6dG7JEuUMAaSlobzm 2uTKWbdYwc2vqNpnLd1CwNxtc7MrQfeFgYEv8jdr4+GNlUVUxCfqRlS8Eteql+LdXvaF 5vIRmFGOti2/sehR6oYBSpzWTe2b0R/kdfxHTprTyHRPYoxS6Lb5az136+nsYeq7I/8X vQt56hoh4ygH1rIL8KvL/KRJDwnQR8jl8pwo35730yLDoyHdCHMGRB/yH7uSwM/oPqEU RbDjmQuIzkmPKIdNN6y1cVOv1hBzaotgAhlvP/xzCfrR/eITsv8zOasrfMvvgiiG3+Ln 7pdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si2505828edb.255.2020.09.03.14.14.06; Thu, 03 Sep 2020 14:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbgICVNM (ORCPT + 99 others); Thu, 3 Sep 2020 17:13:12 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:38507 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbgICVNM (ORCPT ); Thu, 3 Sep 2020 17:13:12 -0400 Received: from dread.disaster.area (pa49-195-191-192.pa.nsw.optusnet.com.au [49.195.191.192]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id DE6678233B3; Fri, 4 Sep 2020 07:13:07 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1kDwXa-0005LV-HQ; Fri, 04 Sep 2020 07:13:06 +1000 Date: Fri, 4 Sep 2020 07:13:06 +1000 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-fsdevel , xfs , linux-btrfs , linux-ext4 , ocfs2 list , Christoph Hellwig , Eric Sandeen , Theodore Ts'o Subject: Re: Broken O_{D,}SYNC behavior with FICLONE*? Message-ID: <20200903211306.GE12131@dread.disaster.area> References: <20200903035225.GJ6090@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903035225.GJ6090@magnolia> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=XJ9OtjpE c=1 sm=1 tr=0 cx=a_idp_d a=vvDRHhr1aDYKXl+H6jx2TA==:117 a=vvDRHhr1aDYKXl+H6jx2TA==:17 a=kj9zAlcOel0A:10 a=reM5J-MqmosA:10 a=7-415B0cAAAA:8 a=FD1UHmYh5NI2xiT9T8wA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Sep 02, 2020 at 08:52:25PM -0700, Darrick J. Wong wrote: > Hi, > > I have a question for everyone-- do FICLONE and FICLONERANGE count as a > "write operation" for the purposes of reasoning about O_SYNC and > O_DSYNC? I'd say yes, because we are changing metadata that is used to directly reference the data in the file. O_DSYNC implies all the metadata needed to access the data is on stable storage when the operation returns.... > So, that's inconsistent behavior and I want to know if remap_file_range > is broken or if we all just don't care about O_SYNC for these fancy > IO accelerators? Perhaps we should pay attention to the NFSD implementation of CloneFR - if the operation is sync then it will run fsync on the destination and commit_metadata on the source inode. See nfsd4_clone_file_range(). So, yeah, I think clone operations need to pay attention to O_DSYNC/O_SYNC/IS_SYNC().... Cheers, Dave. -- Dave Chinner david@fromorbit.com