Re: btrfs truncate() does not change inode times

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

 



idank wrote:
> Hi all,
> I was running fstest (http://www.tuxera.com/community/posix-test-suite/) on btrfs. Only one test failed, and I believe it to be a bug in btrfs. The scenario is as follows:
> * crate a file.
> * note its times with stat.
> * sleep a few seconds
> * call truncate() on the file (not ftruncate(). ftruncate() works).
> * sync
> * note the file's times again with stat.
> expected result: ctime and mtime are greater.
> actual result: ctime and mtime remain unchanged.
> 
> Example:

I followed your example, but got the expected result:

[root@lizf pjd-fstest-20090130-RC]# stat ctime_test 
  File: "ctime_test"
  Size: 0               Blocks: 0          IO Block: 4096   普通空文件
Device: 1bh/27d Inode: 1589980     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-01-06 10:27:53.900570365 +0800
Modify: 2012-01-06 10:27:53.900570365 +0800
Change: 2012-01-06 10:27:53.900570365 +0800
[root@lizf pjd-fstest-20090130-RC]# ./fstest truncate ctime_test 200
0
[root@lizf pjd-fstest-20090130-RC]# sleep 2
[root@lizf pjd-fstest-20090130-RC]# stat ctime_test 
  File: "ctime_test"
  Size: 200             Blocks: 0          IO Block: 4096   普通文件
Device: 1bh/27d Inode: 1589980     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-01-06 10:27:53.900570365 +0800
Modify: 2012-01-06 10:28:12.238569720 +0800
Change: 2012-01-06 10:28:12.238569720 +0800
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux