From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDBC4C433E2 for ; Thu, 3 Sep 2020 21:13:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A364E206E7 for ; Thu, 3 Sep 2020 21:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726489AbgICVNM (ORCPT ); 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-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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