From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 26 23:19:31 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B2521065674 for ; Tue, 26 Oct 2010 23:19:31 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id D6D508FC15 for ; Tue, 26 Oct 2010 23:19:30 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PAsne-0004MB-8g for freebsd-hackers@freebsd.org; Wed, 27 Oct 2010 01:19:26 +0200 Received: from 78-1-128-133.adsl.net.t-com.hr ([78.1.128.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Oct 2010 01:19:26 +0200 Received: from ivoras by 78-1-128-133.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Oct 2010 01:19:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Wed, 27 Oct 2010 01:19:18 +0200 Lines: 17 Message-ID: References: <20101026213618.GA3013@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 78-1-128-133.adsl.net.t-com.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20101008 Thunderbird/3.1.4 In-Reply-To: <20101026213618.GA3013@freebsd.org> Subject: Re: fsync(2) manual and hdd write caching X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 23:19:31 -0000 On 10/26/10 23:36, Alexander Best wrote: > hi there, > > since there's a thread on freebsd-questions@ concerning fsync(2) and the fact > that hdd write caching can cause this syscall to basically be a no op, could > somebody please copy the BUGS section from sync(2) to fsync(2)? I don't think they are the same. The "buffers" of sync(2) are not those from the discussion on fsync(2) safety. Or more correctly, they are but those 2 calls work on a different scope. fsync(2) actually does behave as advertised, "auses all modified data and attributes of fd to be moved to a permanent storage device". It is the problem of the "permanent storage device" if it caches this data further.