Re: [PATCH 05/10] rust: xarray: use `xas_load` instead of `xa_load` in `Guard::load`
From: Andreas Hindborg
Date: Thu Jan 08 2026 - 05:46:25 EST
Tamir Duberstein <tamird@xxxxxxxxx> writes:
> On Wed, Jan 7, 2026 at 2:37 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>
>> Tamir Duberstein <tamird@xxxxxxxxx> writes:
>>
>> > On Wed, Dec 3, 2025 at 5:27 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>> >>
>> >> Replace the call to `xa_load` with `xas_load` in `Guard::load`. The
>> >> `xa_load` function takes the XArray lock internally, which would cause
>> >> a double lock since the `Guard` already holds the lock.
>> >
>> > This is not correct. `xa_load` takes and releases the RCU lock only,
>> > not the XArray lock.
>>
>> You are right. However, we do not need to take the RCU lock either in
>> this case, right?
>
> Seems reasonable, but the language mentioning double locking should be
> removed please.
For sure.
Best regards,
Andreas Hindborg