From: Dave Kleikamp Subject: Re: What trigge fsync of file on last close of the open inode? Date: Tue, 03 Oct 2006 15:05:41 -0500 Message-ID: <1159905941.18918.7.camel@kleikamp.austin.ibm.com> References: <4522BFA8.9040000@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Shirish S Pargaonkar Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:49342 "EHLO e2.ny.us.ibm.com") by vger.kernel.org with ESMTP id S1030304AbWJCUFx (ORCPT ); Tue, 3 Oct 2006 16:05:53 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id k93K5rfa020315 for ; Tue, 3 Oct 2006 16:05:53 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k93K5rHP147164 for ; Tue, 3 Oct 2006 16:05:53 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k93K5qKu007902 for ; Tue, 3 Oct 2006 16:05:52 -0400 To: Steve French In-Reply-To: <4522BFA8.9040000@us.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2006-10-03 at 14:53 -0500, Steve French wrote: > What triggers flush/fsync of dirty pages on last (file) close of inode? Nothing. A close doesn't imply fsync. Dirty data is eventually written by pdflush, if something else (memory pressure, maybe) doesn't do it first. > I was hunting through the sys_close code and did not see a call > to fsync or filemap_write_and_wait there. Is it something done in libc > above the vfs? No > Someone had reported a problem with a writepages call coming in on with > no open files (so presumably the file was closed, with dirty pages not > written). This is normal behavior for most file systems. I thought cifs protected this by flushing dirty data in cifs_close. I don't think any data should be dirtied after cifs_close is called (on the last open file handle). -- David Kleikamp IBM Linux Technology Center