mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: SteveD@RedHat.com
Cc: nfs@lists.sourceforge.net, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [NFS] [PATCH] mmap corruption
Date: Sun, 6 Apr 2003 14:30:09 +0200	[thread overview]
Message-ID: <16016.7633.982870.860147@charged.uio.no> (raw)
In-Reply-To: <20030405164741.GA6450@RedHat.com>

>>>>> " " == Steve Dickson <SteveD@RedHat.com> writes:

     > 	filemap_fdatasync(inode->i_mapping);
     > 	error = nfs_wb_all(inode);
     > 	filemap_fdatawait(inode->i_mapping);
     > 	if (error)
     > 		goto out;

     > 	/*
     > * Every time either npages or ncommit had a value and the file
     > 	   size is
     > * immediately changed (with in a microsecond or two) by another
     > * truncation, followed by a mmap read, the file would be
     > 	   corrupted.
     > 	 */
     > 	if (NFS_I(inode)->npages || NFS_I(inode)->ncommit ||
     > 	NFS_I(inode)->ndirty) {
     > 		printk("nfs_notify_change: fid %Ld npages %d ncommit
     > 		%d ndirty %d\n", NFS_FILEID(inode),
     > 		NFS_I(inode)->npages, ncommit, NFS_I(inode)->ndirty);
     > 	}
     > }

My point is that nfs_wb_all() is supposed to ensure that
NFS_I(inode)->ncommit, and/or NFS_I(inode)->ndirty are both
zero. i.e. you can have pending reads (in which case
NFS_I(inode)->npages != 0), but *no* pending writes.

Was this the case?

Cheers,
  Trond

  reply	other threads:[~2003-04-06 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 19:20 Steve Dickson
2003-04-04 22:01 ` Trond Myklebust
2003-04-05 16:47   ` Steve Dickson
2003-04-06 12:30     ` Trond Myklebust [this message]
2003-04-07 14:00       ` Steve Dickson
2003-04-07 14:56         ` Trond Myklebust
2003-04-07 17:39           ` Steve Dickson

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=16016.7633.982870.860147@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=SteveD@RedHat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®