Re: [RFC PATCH 2/3] fat: add renameat2 RENAME_EXCHANGE flag support
From: Javier Martinez Canillas
Date: Mon May 23 2022 - 11:36:06 EST
Hello OGAWA,
Thanks a lot for your feedback.
On 5/22/22 19:42, OGAWA Hirofumi wrote:
> Javier Martinez Canillas <javierm@xxxxxxxxxx> writes:
>
>> The renameat2 RENAME_EXCHANGE flag allows to atomically exchange two paths
>> but is currently not supported by the Linux vfat filesystem driver.
>>
>> Add a vfat_rename_exchange() helper function that implements this support.
>>
>> The super block lock is acquired during the operation to ensure atomicity,
>> and in the error path actions made are reversed also with the mutex held,
>> making the whole operation transactional.
>
> I'm not fully reviewed yet though (write order and race), basically
> looks like good.
>
Thanks for looking at the patch. I agree with all your remarks and will
address them in v2. Please let me know once you have reviewed if is OK
from a write order and race point of view.
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat