All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Sims <lkml-z@robsims.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Change in NFS client behavior
Date: Fri, 2 Sep 2005 09:39:13 -0600	[thread overview]
Message-ID: <20050902153913.GA23328@robsims.com> (raw)
In-Reply-To: <1125632597.8635.9.camel@lade.trondhjem.org>

On Thu, Sep 01, 2005 at 11:43:17PM -0400, Trond Myklebust wrote:
> to den 01.09.2005 Klokka 19:38 (-0400) skreiv Trond Myklebust:
> > This is a consequence of 2.6 NFS clients optimising away unnecessary
> > truncate calls. Whereas this is correct behaviour for truncate(), it
> > appears to be incorrect for open(O_TRUNC).

> > In fact, local filesystems like xfs and ext3 appear to have the opposite
> > problem: they change ctime if you call ftruncate(0) on the zero-length
> > file, as the attached test shows.
 
The following patch fixes the problem, at least when applied against
2.6.8:

--- inode.c.orig        2005-08-31 16:54:27.000000000 -0600
+++ inode.c     2005-08-31 17:06:52.000000000 -0600
@@ -756,7 +756,7 @@
 	int error;
 
 	if (attr->ia_valid & ATTR_SIZE) {
-		if (!S_ISREG(inode->i_mode) || attr->ia_size == i_size_read(inode))
+		if (!S_ISREG(inode->i_mode))
 	attr->ia_valid &= ~ATTR_SIZE;
 	}

> Could you please check if the following patch fixes NFS (and also the
> local filesystems) for you?
 
I'll try the latest in the flood today.  Thanks for all the help!
-- 
Rob

  parent reply	other threads:[~2005-09-02 15:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 14:55 Change in NFS client behavior Rob Sims
2005-09-01 23:38 ` Trond Myklebust
2005-09-02  3:43   ` Trond Myklebust
2005-09-02  3:45     ` Andrew Morton
2005-09-02  3:52       ` Trond Myklebust
2005-09-02  4:07         ` Andrew Morton
2005-09-02  4:15           ` Trond Myklebust
2005-09-02  4:19             ` Trond Myklebust
2005-09-02  4:38               ` Andrew Morton
2005-09-07 14:25               ` Rob Sims
2005-09-02 15:39     ` Rob Sims [this message]
2005-09-02 15:06 ` Drop NFS speed on move from kernel 2.4 to 2.6 (was: Change in NFS client behavior) Tomasz Kłoczko

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=20050902153913.GA23328@robsims.com \
    --to=lkml-z@robsims.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.