public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Allison <jra@samba.org>
To: Steve French <smfltc@us.ibm.com>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>,
	linux-fsdevel@vger.kernel.org,
	Shirish S Pargaonkar <shirishp@us.ibm.com>
Subject: Re: What trigge fsync of file on last close of the open inode?
Date: Tue, 3 Oct 2006 16:13:18 -0700	[thread overview]
Message-ID: <20061003231318.GP16692@linux> (raw)
In-Reply-To: <4522CBFD.3010202@us.ibm.com>

On Tue, Oct 03, 2006 at 03:45:49PM -0500, Steve French wrote:
> Dave Kleikamp wrote:
> >>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).
> >  
> I found it ...
> 
> cifs exports flush, filp_close calls flush (before calling close)
> 
> cifs_flush calls filemap_fdatawrite
> 
> May be a case in which filemap_fdatawrite returns before the write(s) is 
> sent to the vfs and write races with close (although cifs will defer a 
> file close if a write is pending on that handle)?

Steve,

	Here's a comment I found in the NFSv4 code.... might be relevent.

>From /usr/src/linux/fs/nfs/nfs4proc.c

/*
 * It is possible for data to be read/written from a mem-mapped file
 * after the sys_close call (which hits the vfs layer as a flush).
 * This means that we can't safely call nfsv4 close on a file until
 * the inode is cleared.



  parent reply	other threads:[~2006-10-03 23:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-03 19:53 What trigge fsync of file on last close of the open inode? Steve French
2006-10-03 20:05 ` Dave Kleikamp
2006-10-03 20:45   ` Steve French
2006-10-03 21:15     ` Zach Brown
2006-10-03 21:40       ` Dave Kleikamp
2006-10-03 23:43         ` Zach Brown
2006-10-04 15:13       ` Steve French
2006-10-03 23:13     ` Jeremy Allison [this message]
2006-10-04 20:46       ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061003231318.GP16692@linux \
    --to=jra@samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shaggy@austin.ibm.com \
    --cc=shirishp@us.ibm.com \
    --cc=smfltc@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox