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]
Message-ID: <d19ecc4d-968e-9341-aaa5-a6c2c541eefb@gmail.com>
Date:   Wed, 7 Oct 2020 17:13:29 +0900
From:   Tetsuhiro Kohada <kohada.t2@...il.com>
To:     Namjae Jeon <namjae.jeon@...sung.com>
Cc:     kohada.tetsuhiro@...mitsubishielectric.co.jp,
        mori.takahiro@...mitsubishielectric.co.jp,
        'Sungjong Seo' <sj1557.seo@...sung.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] exfat: add exfat_update_inode()

Thank you for your reply.

>>   	new_dir->i_ctime = new_dir->i_mtime = new_dir->i_atime =
>>   		EXFAT_I(new_dir)->i_crtime = current_time(new_dir);
>>   	exfat_truncate_atime(&new_dir->i_atime);
>> -	if (IS_DIRSYNC(new_dir))
>> -		exfat_sync_inode(new_dir);
>> -	else
>> -		mark_inode_dirty(new_dir);
>> +	exfat_update_inode(new_dir);
>>
>>   	i_pos = ((loff_t)EXFAT_I(old_inode)->dir.dir << 32) |
>>   		(EXFAT_I(old_inode)->entry & 0xffffffff);
>>   	exfat_unhash_inode(old_inode);
>>   	exfat_hash_inode(old_inode, i_pos);
>> -	if (IS_DIRSYNC(new_dir))
>> -		exfat_sync_inode(old_inode);
>> -	else
>> -		mark_inode_dirty(old_inode);
>> +	exfat_update_inode(old_inode);
> This is checking if old_inode is IS_DIRSYNC, not new_dir.
> Is there any reason ?

To eliminate meaningless usage and simplify it.

Th exfat does not have an attribute that indicates whether each file/dir should be synced(such as ext4).
Therefore, sync necessity cannot be set for each inode, so sync necessity of the whole FS setting(sb-> s_flags) is inherited.
As a result, the following values ​​are all the same.
  IS_DIRSYNC (new_dir)
  IS_DIRSYNC (old_dir)
  IS_DIRSYNC (old_inode)
  sb-> s_flags & SB_SYNCHRONOUS | SB_DIRSYNC

In exfat, IS_DIRSYNC only works as a shortcut to sb->s_flags.

Even if S_SYNC or S_DIRSYNC were set to inode->i_flags, the current implementation is inappropriate.
Whether to sync or not should be determined by "IS_DIRSYNC(new_dir)||IS_DIRSYNC(old_dir)", I think.
(Syncing only old_dir is a high risk of losing file)

Whatever, no one sets S_SYNC and S_DIRSYNC in exfat, so the behavior is no different.

***
Please tell me your opinion about "aggregate dir-entry updates into __exfat_write_inode()"

BR
---
Tetsuhiro Kohada <kohada.t2@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ