Don't quite understand how hammer behave

Aleksej Lebedev root at zta.lk
Tue Nov 14 05:47:40 PST 2017


Hi, everyone!

I just realized I don't quite understand how history works in HAMMER 1.
Here is what I've done:
1. I create a file account.key:

     # openssl genrsa 4096 >account.key

2. I remembered that my umask is wrong, so I did:

     # chmod og-rwx account.key

3. I wandered what if the system did a sync after I created account.key, 
so I exected:

     # hammer history account.key
     account.key	0000000119ce183e dirty {
         000000011cd57400 14-Nov-2017 16:28:47
     }

4. I checked the size of the file at 000000011cd57400:

     # ls -l account.key
     -rw-------  1 a  a  3243 Nov 14 16:28 account.key
     # ls -l account.key@@0x000000011cd57400
     -rw-r--r--  1 a  a  3243 Nov 14 16:28 
account.key@@0x000000011cd57400

5. Indeed the file had the same size as it is now, so the data must be 
there. However the content is different:

     # md5 account.key
     MD5 (account.key) = 4ec8b463d6862930f52b7f416688990c
     # md5 account.key@@0x000000011cd57400
     MD5 (account.key@@0x000000011cd57400) = 
41a414bd664486f270ea8d7ff1f2f392

6. This is because the content at 000000011cd57400 was all 0:

     # od -h account.key@@0x000000011cd57400
     0000000      0000    0000    0000    0000    0000    0000    0000    
0000
     *
     0006240

My question is how is it possible that the file contained zeros?
Well, it didn't cause any problem, I'm just curious how it's possible.
At any moment of time the command "openssl genrsa 4096 >account" could 
not produce the file with all zeros in it.
So what does the state of the file system (specifically, 
000000011cd57400) correspond to?

Thanks a lot.

-- 
Aleksej Lebedev



More information about the Users mailing list