Re: [PATCH v9 06/10] fsdax: Introduce dax_lock_mapping_entry()

From: Dan Williams
Date: Tue Jan 04 2022 - 17:56:09 EST


On Sun, Dec 26, 2021 at 6:35 AM Shiyang Ruan <ruansy.fnst@xxxxxxxxxxx> wrote:
>
> The current dax_lock_page() locks dax entry by obtaining mapping and
> index in page. To support 1-to-N RMAP in NVDIMM, we need a new function
> to lock a specific dax entry corresponding to this file's mapping,index.
> And output the page corresponding to the specific dax entry for caller
> use.

Is this necessary? The point of dax_lock_page() is to ensure that the
fs does not destroy the address_space, or remap the pfn while
memory_failure() is operating on the pfn. In the notify_failure case
control is handed to the fs so I expect it can make those guarantees
itself, no?