Re: [PATCH v2 2/5] fuse: Create helper function if DIO write needs exclusive lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2/6/24 10:20, Jingbo Xu wrote:
> 
> 
> On 2/1/24 7:08 AM, Bernd Schubert wrote:
>> @@ -1591,10 +1616,10 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from)
>>  	else {
>>  		inode_lock_shared(inode);
>>  
>> -		/* A race with truncate might have come up as the decision for
>> -		 * the lock type was done without holding the lock, check again.
>> +		/*
>> +		 * Previous check was without any lock and might have raced.
>>  		 */
>> -		if (fuse_direct_write_extending_i_size(iocb, from)) {
>> +		if (fuse_dio_wr_exclusive_lock(iocb, from)) {
> 			^
> 
> The overall is good.  Maybe fuse_io_past_eof() is better to make it a
> solely cleanup or refactoring.  Actually it's already changed back to
> fuse_io_past_eof() in patch 3/5.

So I'm bit confused what you would like to see improved. Patch 2/5
renames "fuse_direct_write_extending_i_size" to "fuse_io_past_eof" and
also moves it up in the file. (The latter is a preparation for my
direct-write consolidation patches.). It also creates the helper
function fuse_dio_wr_exclusive_lock(). None of that is changed in 3/5,
which just moves the locking/unlocking from fuse_cache_write_iter() into
the functions fuse_dio_lock/fuse_dio_unlock.


Thanks,
Bernd




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux