[patch 2/3] New function: au_add_muldiv_till_max

2012-03-13 Thread Daniel Alder
Preparation patch for bugfix-sums-with-different-block-size.patch A new function au_add_muldiv_till_max which works like au_add_till_max but adds the result of b*mul/div instead of just b. NEED SOME HELP HERE: the function is not overflow-safe yet. I think there must be such functions in the ke

[patch 3/3] Bugfix: au_statfs_sum calculates wrong sums when different block sizes are used

2012-03-13 Thread Daniel Alder
If aufs is mounted in sum mode, but the source file systems have different block sizes, the result of the statfs is the sum of all block counts which does not make sense. This patch corrects this problem by normalizing the block counts to the same block size and then adds them. Index: aufs3-stan

[patch 0/3] aufs returns wrong block numbers when the block sizes of its sources are different

2012-03-13 Thread Daniel Alder
There were two problems: 1) au_add_till_max returns ULLONG_MAX if b==0 Reason: in this case, a is not bigger then old but equal. This is the reason for the very big values which confuse df. 2) If aufs is mounted in sum mode, but the source file systems have different block sizes, the result o

[patch 1/3] Bugfix: au_add_till_max wrongly detects overflow if b==0

2012-03-13 Thread Daniel Alder
If argument b is set to 0, au_add_till_max returns the value of constant ULLONG_MAX. In this case, old is equal to a and the condition fails. Index: aufs3-standalone.git/fs/aufs/super.c === --- aufs3-standalone.git.orig/fs/aufs/super.

Re: [patch 0/3] aufs returns wrong block numbers when the block sizes of its sources are different

2012-03-14 Thread Daniel Alder
quilt according to a tutorial. unfortunately, I got a bounce message from the Mail list. That's the reason why I sent it twice (in different formats). Daniel Alder -- Virtualization & Cloud Management Using Cap

Re: [patch 0/3] aufs returns wrong block numbers when the block sizes of its sources are different

2012-03-14 Thread Daniel Alder
>> The sum is either >> >> (7*131072/131072 + 5*4096/131072 + ...) if reported bsize is 131072 >> (7*131072/4096 + 5*4096/4096 + ...) if reported bsize is 4096 > > No. > We don't have to calculate it by the unit of byte. The unit should be > block. So the sum should be either (7+1)=8 or (7*32+5)=22

Re: [patch 0/3] aufs returns wrong block numbers when the block sizes of its sources are different

2012-03-19 Thread Daniel Alder
the block counts to the same block size and then adds them. Signed-off-by: Daniel Alder Index: aufs3-standalone.git/fs/aufs/super.c === --- a/fs/aufs/super.c +++ b/fs/aufs/super.c @@ -305,7 +305,18 @@ static u64 au_add_till_max(u64 a

Re: [patch 0/3] aufs returns wrong block numbers when the block sizes of its sources are different

2012-03-20 Thread Daniel Alder
Yes, I was confused. But now I think I understand. Btw: your english is not worse than mine.. Here we go: Signed-off-by: Daniel Alder Index: aufs/fs/aufs/super.c === --- aufs.orig/fs/aufs/super.c 2012-03-20 11:00

Re: copy-on-open for aufs3.0

2012-04-21 Thread Daniel Alder
Hello Preeti If you do the same by using Fanotify, you don't even have to touch the kernel and your program can run completely in user space. Daniel Alder On 21.04.2012 09:06, sf...@users.sourceforge.net wrote: > > Hello Preeti, > > Preeti Sharma: >> I am new to auf