[RFC] [PATCH] do_sys_truncate: call do_truncate with ATTR_MTIME|ATTR_CTIME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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 <[email protected]>



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 ---

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux