From: Andrew Morton <akpm@digeo.com>
To: Andries.Brouwer@cwi.nl
Cc: linux-fs@cwi.nl, linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [patch?] truncate and timestamps
Date: Thu, 22 May 2003 16:20:02 -0700 [thread overview]
Message-ID: <20030522162002.1d45a056.akpm@digeo.com> (raw)
In-Reply-To: <UTC200305221909.h4MJ9h903738.aeb@smtp.cwi.nl>
Andries.Brouwer@cwi.nl wrote:
>
> Investigating why some SuSE init script no longer works, I find:
> The shell command
> > file
> does not update the time stamp of file in case it existed and had size 0.
oops. That's due to me "don't call vmtruncate if i_size didn't change"
speedup. It was a pretty good speedup too.
Does this look sane?
25-akpm/fs/attr.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff -puN fs/attr.c~a fs/attr.c
--- 25/fs/attr.c~a Thu May 22 16:16:33 2003
+++ 25-akpm/fs/attr.c Thu May 22 16:18:13 2003
@@ -68,10 +68,17 @@ int inode_setattr(struct inode * inode,
int error = 0;
if (ia_valid & ATTR_SIZE) {
- if (attr->ia_size != inode->i_size)
+ if (attr->ia_size != inode->i_size) {
error = vmtruncate(inode, attr->ia_size);
- if (error || (ia_valid == ATTR_SIZE))
- goto out;
+ if (error)
+ goto out;
+ } else {
+ /*
+ * We skipped the truncate but must still update
+ * timestamps
+ */
+ ia_valid |= ATTR_MTIME|ATTR_CTIME;
+ }
}
lock_kernel();
_
next prev parent reply other threads:[~2003-05-22 23:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-22 19:09 [patch?] truncate and timestamps Andries.Brouwer
2003-05-22 23:20 ` Andrew Morton [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-05-23 0:17 Andries.Brouwer
2003-05-23 0:30 ` Linus Torvalds
2003-05-23 1:17 ` viro
2003-05-23 2:42 ` Andrew Morton
2003-05-23 5:11 ` Trond Myklebust
2003-05-23 5:25 ` Trond Myklebust
2003-05-23 3:14 ` David Schwartz
2003-05-26 23:42 ` Alan Cox
2003-05-27 1:17 ` Andrew Morton
2003-05-23 18:02 ` Kai Henningsen
2003-05-23 19:07 ` Andries Brouwer
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=20030522162002.1d45a056.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=Andries.Brouwer@cwi.nl \
--cc=linux-fs@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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