[RFC] [PATCH] do_sys_truncate: call do_truncate withATTR_MTIME|ATTR_CTIME

From: Vladimir V. Saveliev
Date: Fri Jun 30 2006 - 09:38:47 EST


Hello

do_sys_ftruncate calls do_truncate with time_attrs set to ATTR_MTIME|
ATTR_CTIME. Is there a reason for do_sys_truncate to not set time_attrs
to the same value or it is a bug?



--- Begin Message --- From: Vladimir Saveliev <vs@xxxxxxxxxxx>

When do_truncate is called from do_sys_truncate it is not given
ATTR_MTIME|ATTR_CTIME as in case when it is called from
do_sys_ftruncate. The patch fixes this unfairness.

Signed-off-by: Vladimir Saveliev <vs@xxxxxxxxxxx>



diff -puN fs/open.c~do_truncate-time_attrs fs/open.c
--- linux-2.6.17-mm3/fs/open.c~do_truncate-time_attrs 2006-06-30 16:41:21.000000000 +0400
+++ linux-2.6.17-mm3-root/fs/open.c 2006-06-30 16:49:54.000000000 +0400
@@ -270,7 +270,7 @@ static long do_sys_truncate(const char _
error = locks_verify_truncate(inode, NULL, length);
if (!error) {
DQUOT_INIT(inode);
- error = do_truncate(nd.dentry, length, 0, NULL);
+ error = do_truncate(nd.dentry, length, ATTR_MTIME|ATTR_CTIME, NULL);
}
put_write_access(inode);


_

--- End Message ---