EldoS | Feel safer!

Software components for data protection, secure storage and transfer

The performance of version 4 and 5 of fusecbfs

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#30371
Posted: 08/15/2014 03:41:21
by lingbo meng (Basic support level)
Joined: 09/16/2013
Posts: 24

First ,I agree your view: parses full path in order to check whether the directories in the path exists.
But when i copy a file to z:\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k,
The function of getattr is called 5(or 2) times;Why here is 5(or 2) times,but not 1 time? if getattr is called 1 time ,so i think the performance is better.
#30377
Posted: 08/15/2014 08:34:11
by Volodymyr Zinin (EldoS Corp.)

Is getattr called 5 times before each file creation?

In the case the metadata cache is enabled the algorithm of file opening should be the following:
1. The create request for "\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k" comes to the CBFS file system. CBFS starts parsing the path and finds that information about the directories is not in the cache yet. So for each directory in the path it calls the getattr callback. After everything in the path has been parsed the "create file" callback is called.
2. When another file is being opened and CBFS is parsing the path then information about the directories is already in the metadata cache and the getattr callback for these directories isn't called.
#30378
Posted: 08/15/2014 09:36:22
by lingbo meng (Basic support level)
Joined: 09/16/2013
Posts: 24

1 Is getattr called 5 times before each file creation?
yes
2 The process you metioned ,in version 4, the metedatacache is enabled default ?
Is it no necessary to set SETMETADATACACHE(1) in fuse_main of fuse_cbfs.cpp ?
if so,my result is not the same to you.
3 if metedatacache is enabled default ,my result is that the getattr is called 5 times every file ,and all files copy to the same direction.

4 If you are right,where the direction information is cached ? in user mode or kernel mode ?
5 What is the different of filecache and metedatacache and nonexist file cache ?

thanks
#30381
Posted: 08/15/2014 14:13:48
by Volodymyr Zinin (EldoS Corp.)

Quote
lingbo meng wrote:
2 The process you metioned ,in version 4, the metedatacache is enabled default ?

By default it is enabled. But what CBFS version (4 or 5) are you using for testing?

Quote
lingbo meng wrote:
Is it no necessary to set SETMETADATACACHE(1) in fuse_main of fuse_cbfs.cpp ?

It's not necessary, but for clearness it's better to do.

Quote
lingbo meng wrote:
4 If you are right,where the direction information is cached ? in user mode or kernel mode ?

In kernel mode.

Quote
lingbo meng wrote:
5 What is the different of filecache and metedatacache and nonexist file cache ?

File cache is used to cache file contents (its data).
Metadata cache caches information about the file - name, size, last write time, creation time, etc.
Nonexistent file cache contains file names for which the getattr callback returned the "file not found" error. So on another request to open the same file neither getattr nor "open file" callbacks won't be called and the CBFS driver completes the original open request with the "file not found" error.
#30382
Posted: 08/15/2014 23:30:47
by lingbo meng (Basic support level)
Joined: 09/16/2013
Posts: 24

一 I test version 4,under is the test of fuse_mapper.
二 first,I copy a file of file1 to z:/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1
then copy file2 to z:/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1
The process is :
1 fuse_opendir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x062b1a08)
2 fuse_getattr(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", statbuf=0x0465e660)
ERROR fuse_getattr lstat: No such file or directory
3 fuse_releasedir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x062b1a08)
4 fuse_getattr(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", statbuf=0x04faf57c)
ERROR fuse_getattr lstat: No such file or directory
5 fuse_create(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", mode=0600, fi=0x00a7ddb0)
6 fuse_opendir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x00a7f1a0)
7 fuse_getattr(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", statbuf=0x058be210)
8 fuse_releasedir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x00a7f1a0)
9 fuse_ftruncate(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", offset=1024, fi=0x00a7ddb0)
10 fuse_write(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", buf=0x028f0000, size=400, offset=0, fi=0x00a7ddb0)
11 fuse_chmod(fpath="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", mode=0600)
12 fuse_chmod(fpath="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", mode=0600)
13 fuse_release(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", fi=0x00a7ddb0)
14 fuse_opendir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x00a7e018)
15 fuse_getattr(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", statbuf=0x03f7e240)
16 fuse_releasedir(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1", fi=0x00a7e018)
17 fuse_getattr(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", statbuf=0x037feefc)
18 fuse_open(path"/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", fi=0x062b19f0)
19 fuse_chmod(fpath="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", mode=0600)
20 fuse_release(path="/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/1k1/file2", fi=0x062b19f0)
I think there is some redundant process ,for example 5 times of calling fuse_getattr ,here is not you mentioned of cached the direction information
#30400
Posted: 08/18/2014 04:29:38
by Volodymyr Zinin (EldoS Corp.)

Thank you for it. I will check it in several days and write the result. But in any case any possible fix will be done only for CBFS version 5.
#30588
Posted: 09/03/2014 08:53:05
by Volodymyr Zinin (EldoS Corp.)

Sorry for the delay. I have checked the problem with the CBFS ver5 and the behavior corresponds to what I wrote above:
Quote
In the case the metadata cache is enabled the algorithm of file opening should be the following:
1. The create request for "\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k\cbfs1k" comes to the CBFS file system. CBFS starts parsing the path and finds that information about the directories is not in the cache yet. So for each directory in the path it calls the getattr callback. After everything in the path has been parsed the "create file" callback is called.
2. When another file is being opened and CBFS is parsing the path then information about the directories is already in the metadata cache and the getattr callback for these directories isn't called.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 3590 times

Number of guests: 2, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!