From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Subject: munmap doesn't imply msync even with O_SYNC, right? Date: Wed, 19 Mar 2014 10:42:44 -0400 (EDT) Message-ID: <2140536247.2055757.1395240164378.JavaMail.zimbra@redhat.com> References: <904844963.2047690.1395239482118.JavaMail.zimbra@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from mx3-phx2.redhat.com ([209.132.183.24]:36583 "EHLO mx3-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932861AbaCSOmo (ORCPT ); Wed, 19 Mar 2014 10:42:44 -0400 Received: from zmail12.collab.prod.int.phx2.redhat.com (zmail12.collab.prod.int.phx2.redhat.com [10.5.83.14]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2JEgiVU022714 for ; Wed, 19 Mar 2014 10:42:44 -0400 In-Reply-To: <904844963.2047690.1395239482118.JavaMail.zimbra@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, I've read the various man pages and past discussions, so I think I already know the answer, but I just want some clarity from the experts: If I have a program that does open / mmap / memcpy / munmap there is no implied blocking writeback of the dirty pages at munmap, right? Even if the file was opened O_SYNC? In other words, if these events happen... (1) open w/O_SYNC (2) mmap some region (3) memcpy to dirty some pages (4) munmap the region (5) someone kills the power after the munmap completes successfully ...You can still see data corruption because the dirty pages may still have been dirty in page cache when the power went out. Correct? The same thing applies even if the file is closed before the power goes out, right? (All assuming no calls to msync). Regards, Bob Peterson