btrfs-snap icon indicating copy to clipboard operation
btrfs-snap copied to clipboard

Problem with time and stat

Open Djabx opened this issue 7 years ago • 0 comments

I'm on a Ubuntu 16.04

And here is my problem:

root:/mnt/root# btrfs sub create test 
Create subvolume './test'
root:/mnt/root# cd test/

root:/mnt/root/test# stat /mnt/root/test
  File: '/mnt/root/test'
  Size: 0         	Blocks: 0          IO Block: 4096   directory
Device: 3eh/62d	Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-02-08 15:55:13.916941738 +0100
Modify: 2018-02-08 15:55:11.144919869 +0100
Change: 2018-02-08 15:55:11.144919869 +0100
 Birth: -

root:/mnt/root/test# touch test_file
root:/mnt/root/test# stat /mnt/root/test
  File: '/mnt/root/test'
  Size: 18        	Blocks: 0          IO Block: 4096   directory
Device: 3eh/62d	Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-02-08 15:55:13.916941738 +0100
Modify: 2018-02-08 15:55:35.401111346 +0100
Change: 2018-02-08 15:55:35.401111346 +0100
 Birth: -

root:/mnt/root/test# mkdir subdir
root:/mnt/root/test# stat /mnt/root/test
  File: '/mnt/root/test'
  Size: 30        	Blocks: 0          IO Block: 4096   directory
Device: 3eh/62d	Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-02-08 15:55:13.916941738 +0100
Modify: 2018-02-08 15:55:46.333197729 +0100
Change: 2018-02-08 15:55:46.333197729 +0100
 Birth: -

root:/mnt/root/test# touch subdir/subfile
root:/mnt/root/test# stat /mnt/root/test
  File: '/mnt/root/test'
  Size: 30        	Blocks: 0          IO Block: 4096   directory
Device: 3eh/62d	Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-02-08 15:55:54.017258478 +0100
Modify: 2018-02-08 15:55:46.333197729 +0100
Change: 2018-02-08 15:55:46.333197729 +0100
 Birth: -

root:/mnt/root/test# btrfs --version
btrfs-progs v4.4

As you can see, I create a sub volume, some directories and some files.

The problem is, if I modifiy a file in a subdirecto, it doest not update the modification date of the subvolume.

The problem is that btrfs-snap -t and btrfs-snap -T use the stat command to know if the snapshot should be done or not.

Djabx avatar Feb 08 '18 15:02 Djabx