Re: [PATCH] btrfs/volumes: Improve unlocking of a mutex in __btrfs_balance()

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

 



>> @@ -3682,7 +3678,7 @@ static int __btrfs_balance(struct btrfs_fs_info *fs_info)
>>  		counting = false;
>>  		goto again;
>>  	}
>> -error:
>> +free_path:
>>  	btrfs_free_path(path);
>>  	if (enospc_errors) {
>>  		btrfs_info(fs_info, "%d enospc errors during balance",
>> @@ -3692,6 +3688,10 @@ static int __btrfs_balance(struct btrfs_fs_info *fs_info)
>>  	}
>>  
>>  	return ret;
>> +
>> +unlock:
>> +	mutex_unlock(&fs_info->delete_unused_bgs_mutex);
>> +	goto free_path;
>>  }
> 
> This is also an anti-pattern,

I got an other software development opinion for this use case.


> the label followed by a goto jumping back to the exit/cleanup block,
> right at the end of a function.

I find that this way can be useful for efficient exception handling.


> I've sent some patches in the past to clean that up

Interesting …


> and don't want to reintroduce it.

Would you like to reconsider this view if the object code size
could be reduced a bit for the affected function implementation?

Regards,
Markus



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