[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-xfs
Subject:    Re: [PATCH v4 07/13] lib: test_hmm add ioctl to get zone device type
From:       "Sierra Guiza, Alejandro (Alex)" <alex.sierra () amd ! com>
Date:       2022-05-31 19:19:45
Message-ID: 2600dde0-be65-f1f8-1563-4f3753a395aa () amd ! com
[Download RAW message or body]


On 5/31/2022 12:31 PM, Andrew Morton wrote:
> On Tue, 31 May 2022 10:56:23 -0500 Alex Sierra <alex.sierra@amd.com> wrote:
>
>> new ioctl cmd added to query zone device type. This will be
>> used once the test_hmm adds zone device coherent type.
>>
>> @@ -1026,6 +1027,15 @@ static int dmirror_snapshot(struct dmirror *dmirror,
>>   	return ret;
>>   }
>>   
>> +static int dmirror_get_device_type(struct dmirror *dmirror,
>> +			    struct hmm_dmirror_cmd *cmd)
>> +{
>> +	mutex_lock(&dmirror->mutex);
>> +	cmd->zone_device_type = dmirror->mdevice->zone_device_type;
>> +	mutex_unlock(&dmirror->mutex);
> What does the locking here do?
>
> Presumably cmd->zone_device_type can become out of date the instant the
> mutex is released, so what was the point in taking the mutex?

Actually this is not used at all. Thanks for finding it. Honestly, I 
don't remember what we used this type request for.
I will remove all related code   and send a new patch series version.

Regards,
Alex Sierra
>
> And does it make sense to return potentially out-of-date info to
> userspace?  Perhaps this interface simply shouldn't exist?
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic