lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 8 Jan 2018 19:23:11 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Yunlong Song <yunlong.song@...wei.com>,
        Jaegeuk Kim <jaegeuk@...nel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>
CC:     <miaoxie@...wei.com>, chao <chao@...nel.org>,
        <bintian.wang@...wei.com>, <heyunlei@...wei.com>,
        "shengyong (A)" <shengyong1@...wei.com>
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: show precise # of blocks that
 user/root can use

On 2018/1/5 15:05, Yunlong Song wrote:
> NACK
> 
> man statfs shows:
> 
> struct statfs {
>      ...
>      fsblkcnt_t   f_bfree;   /* free blocks in fs */
>      fsblkcnt_t   f_bavail;  /* free blocks available to
>                                      unprivileged user */
>      ...
> }
> 
> f_bfree is free blocks in fs, so buf->bfree should be
> 
> buf->f_bfree = user_block_count - valid_user_blocks(sbi) + ovp_count;

As I checked, some filesystems reserving over-privision space like
btrfs/xfs/ubifs, they will not calculate those space into f_bfree, IMO, we
should follow their behavior to keep compatibility for old applications.

Thanks,

> 
> On 2018/1/4 2:58, Jaegeuk Kim wrote:
>> Let's show precise # of blocks that user/root can use through bavail and bfree
>> respectively.
>>
>> Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
>> ---
>>   fs/f2fs/super.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index 0a820ba55b10..4c1c99cf54ef 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -1005,9 +1005,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
>>   	buf->f_bsize = sbi->blocksize;
>>   
>>   	buf->f_blocks = total_count - start_count;
>> -	buf->f_bfree = user_block_count - valid_user_blocks(sbi) + ovp_count;
>> -	buf->f_bavail = user_block_count - valid_user_blocks(sbi) -
>> +	buf->f_bfree = user_block_count - valid_user_blocks(sbi) -
>>   						sbi->current_reserved_blocks;
>> +	buf->f_bavail = buf->f_bfree;
>>   
>>   	avail_node_count = sbi->total_node_count - sbi->nquota_files -
>>   						F2FS_RESERVED_NODE_NUM;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ