Commit 78e1b029 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] truncate and timestamps

This patch will put us back to the 2.4 behaviour while preserving the
truncation speedup.  It's a bit dopey (why do the timestamp update in
the fs at all?) but changing this stuff tends to cause subtle
problems.
parent 6e9445e6
......@@ -68,10 +68,17 @@ int inode_setattr(struct inode * inode, struct iattr * attr)
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;
} else {
/*
* We skipped the truncate but must still update
* timestamps
*/
ia_valid |= ATTR_MTIME|ATTR_CTIME;
}
}
lock_kernel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment