From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulrich Drepper Subject: Re: adding proper O_SYNC/O_DSYNC, was Re: O_DIRECT and barriers Date: Fri, 28 Aug 2009 13:51:03 -0700 Message-ID: <4A984337.7080009@redhat.com> References: <20090821174525.GA28861@infradead.org> <20090822005006.GA22530@shareable.org> <20090824023422.GA775@infradead.org> <20090827143459.GB31453@shareable.org> <20090827171044.GA5427@infradead.org> <4A96C14C.8040105@redhat.com> <20090828154647.GA15808@infradead.org> <4A98008B.6050503@redhat.com> <20090828161745.GA8755@infradead.org> <4A9806D9.5050409@redhat.com> <20090828164106.GA9951@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jamie Lokier , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15175 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195AbZH1Uvf (ORCPT ); Fri, 28 Aug 2009 16:51:35 -0400 In-Reply-To: <20090828164106.GA9951@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 08/28/2009 09:41 AM, Christoph Hellwig wrote: > Yeah. The implementation really is trivial in 2.6.32 - we basically > just need to change one function to check the new O_REALLY_SYNC flag > and pass down a 0 instead of a 1 to another routine in the generic > fs code, plus doing the same in a few filesystems opencoding it inste= ad > of using the generic helpers. I don't think you have to change anything. As I wrote before, the=20 kernel ignores unknown O_* flags. It's usually a problem. Here it is = a=20 positive thing. > So the logistics of doing the flags really is the biggest work here. > And I'm not entirely sure how to do it correctly. Can we just switch > the current O_SYNC defintion in the kernel headers to O_DSYNC while > adding the new O_SYNC and everything will continue to work? No, that's not a good idea. This would mean a program compiled with=20 newer headers is using O_SYNC which isn't known to old kernels and=20 ignored. Such programs will then not even get the current O_DSYNC bene= fits. > That includes a write from another process? So O_RSYNC basically mea= ns > doing an range-fdatasync before the actual read request? Yes. You can easily see how this can be useful. > Again, we could implement this easily if we care enough. I think it can be useful at times. --=20 =E2=9E=A7 Ulrich Drepper =E2=9E=A7 Red Hat, Inc. =E2=9E=A7 444 Castro S= t =E2=9E=A7 Mountain View, CA =E2=9D=96 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html