From nobody Sun May 24 20:33:11 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBFBC324716 for ; Fri, 22 May 2026 16:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465620; cv=none; b=tPTRosKw8hlrqubnCB2AQWpUr5pSmKKo2MdlogrsLv9a7lS/dOh5z2/D7E9v3JKzJR3ihLIYbv23zKQnLgJfrs6ZRz2Y6t2r+9u8BXl4vdEPmAzRtRvtB8LLBAQrL4Tp5/5WeDTWETKciELfIlKy8svjpxkT8pWYrz1pvM5UrGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465620; c=relaxed/simple; bh=gjTLxm0IhdUF+Cu6h4zY+Rk7QBKewHR4TjsBWZGAj8E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sisAXF/kMHdv5F0icQGb4rFnZKODxdzxxVt0uaJga6lVzCb2buyQRICPchP23eBjv8UgI/UhRHLHgotEPjowpZB/8AEf7YcT2OtwDf3VXVd0cFxXtl3B6AkvRJjsgtB+LxP8MRtg42ln2tm8IGC9HT+lmsU3IjWZkwjzPi6aif4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RHdFvXgs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RHdFvXgs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B653B1F000E9; Fri, 22 May 2026 16:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779465618; bh=8LOOvoPFc1mo7/HC1v7nzO3pf/LAnx00Q0CZDsLJWW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RHdFvXgsYN95BR9977HUHQQgTuhBtlxR8o+rQH02po4VcJ//Nh2tmhcBYlkvtVX9s kCULTY/FXdP2cjhP32hzVQG14Wxqy/JHiidi7bkTVckgN8VxTVXaN2pO/3GexjKY4O 9qz1T10MsuxxuMX6XEo0IwzY0TJbbg7GebhVqPD06vp0d0aql20oAETS5HY02gs09t 2mavmvbFhp+AW5ZpGCIz9uDOPS3a+aDeCN6bjOJWX6km0Z3BEZsBOFwig0W8GrX4xp WNv9HnqiUKRFuWiCeS3L+2Zavc2v9xE9xw8fnTIlff6X6FmJNcDBTpMn5wlQWgRZzR o7gjjUl998aAg== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 1/3] drivers/char/mem: eliminate unnecessary use of success_hook Date: Fri, 22 May 2026 17:00:09 +0100 Message-ID: <5d1e8bd29d6e070218ba7a03461df562e372b91e.1779462249.git.ljs@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" /dev/zero, uniquely, marks memory mapped there as anonymous. This is currently achieved using the mmap_action->success_hook. However this hook circumvents the abstraction of VMA initialisation so it's preferable to do things a different way. To achieve this, this patch firstly defaults the VMA descriptor's vm_ops field to the dummy VMA operations, which is what file-backed VMAs default this field to. That way, we can detect whether a driver sets this field to NULL in order to mark it anonymous. We then introduce vma_desc_set_anonymous() to do this explicitly, and invoke it in mmap_zero_prepare(). This way, any driver which does not explicitly set desc->vm_ops, retains the dummy vm_ops as they would previously. We also update set_vma_user_defined_fields() to make clear that we are either setting vma->vm_ops to what is provided by the driver (or defaulting to dummy_vm_ops if not set), or setting the VMA anonymous. This lays the groundwork for removing the success hook. Signed-off-by: Lorenzo Stoakes --- drivers/char/mem.c | 17 +++++------------ include/linux/mm.h | 5 +++++ mm/util.c | 1 + mm/vma.c | 3 +++ tools/testing/vma/include/dup.h | 1 + 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 5fd421e48c04..a4297eb39887 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -504,17 +504,6 @@ static ssize_t read_zero(struct file *file, char __use= r *buf, return cleared; } =20 -static int mmap_zero_private_success(const struct vm_area_struct *vma) -{ - /* - * This is a highly unique situation where we mark a MAP_PRIVATE mapping - * of /dev/zero anonymous, despite it not being. - */ - vma_set_anonymous((struct vm_area_struct *)vma); - - return 0; -} - static int mmap_zero_prepare(struct vm_area_desc *desc) { #ifndef CONFIG_MMU @@ -523,7 +512,11 @@ static int mmap_zero_prepare(struct vm_area_desc *desc) if (vma_desc_test(desc, VMA_SHARED_BIT)) return shmem_zero_setup_desc(desc); =20 - desc->action.success_hook =3D mmap_zero_private_success; + /* + * This is a highly unique situation where we mark a MAP_PRIVATE mapping + * of /dev/zero anonymous, despite it not being. + */ + vma_desc_set_anonymous(desc); return 0; } =20 diff --git a/include/linux/mm.h b/include/linux/mm.h index 9cedc5e75aa9..2138c86403f5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1489,6 +1489,11 @@ static inline void vma_set_anonymous(struct vm_area_= struct *vma) vma->vm_ops =3D NULL; } =20 +static inline void vma_desc_set_anonymous(struct vm_area_desc *desc) +{ + desc->vm_ops =3D NULL; +} + static inline bool vma_is_anonymous(struct vm_area_struct *vma) { return !vma->vm_ops; diff --git a/mm/util.c b/mm/util.c index 3cc949a0b7ed..2b2a9df689d7 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1192,6 +1192,7 @@ void compat_set_desc_from_vma(struct vm_area_desc *de= sc, desc->vm_file =3D vma->vm_file; desc->vma_flags =3D vma->flags; desc->page_prot =3D vma->vm_page_prot; + desc->vm_ops =3D vma->vm_ops; =20 /* Default. */ desc->action.type =3D MMAP_NOTHING; diff --git a/mm/vma.c b/mm/vma.c index d90791b00a7b..9eea2850818a 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2697,6 +2697,8 @@ static void set_vma_user_defined_fields(struct vm_are= a_struct *vma, { if (map->vm_ops) vma->vm_ops =3D map->vm_ops; + else /* Only /dev/zero should do this. */ + vma_set_anonymous(vma); vma->vm_private_data =3D map->vm_private_data; } =20 @@ -2744,6 +2746,7 @@ static unsigned long __mmap_region(struct file *file,= unsigned long addr, .action =3D { .type =3D MMAP_NOTHING, /* Default to no further action. */ }, + .vm_ops =3D &vma_dummy_vm_ops, }; bool allocated_new =3D false; int error; diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index 9e0dfd3a85b0..306171d061e7 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1303,6 +1303,7 @@ static inline void compat_set_desc_from_vma(struct vm= _area_desc *desc, desc->vm_file =3D vma->vm_file; desc->vma_flags =3D vma->flags; desc->page_prot =3D vma->vm_page_prot; + desc->vm_ops =3D vma->vm_ops; =20 /* Default. */ desc->action.type =3D MMAP_NOTHING; --=20 2.54.0 From nobody Sun May 24 20:33:11 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E0C434A3A5 for ; Fri, 22 May 2026 16:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465622; cv=none; b=AtOeCDf+akF54URsuZGgm7FaVEjTHMGeFw9zvtuKzP/FXTZ6PSeeAyXVS/rwnkw5nC2fitQJhvKb3C/blw3LqurXQfpQz1E9mIENzwIm4vmRQ6F+UAO1KBZU5x2wOgOhceQgGro9UOjEkoxDVoM0to1Gfpn5H2FoXdmpqqrknwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465622; c=relaxed/simple; bh=wRHYKq/PDVTqZM6iI7bL9QouEloKI09JW2ctjbszr+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nn/6IUJcsoEKxDjxAkuIH8Io24vgOROs4PS+JhUF087mRFj7XXEVXbXlpEwJ9aYS0ChJ1hJ2l5LQ5P1uFTCOTclquMAjBloUROAn8MWimMm1ClSATEtggz0yKZAe3c/MG21aFt0ekLXplOeciXOb+Rnh4L6Kwn/plik/kN0usuM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y2bjIlf2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y2bjIlf2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D861F00A3D; Fri, 22 May 2026 16:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779465621; bh=2/lmuTiZtPMl17nLhjSbVCW4szwACwBZSRvlcNxu5fk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y2bjIlf2K3GDTF/EjDuqYrr09Zq8Y3kryDvD76ONFa0zAwm+lDaiHhSpjFqm8V4ig c/5PRUbz0vu5jSxMcz1kNWpVJh+Fxal2fdKMBIiSawEWAMmqH8CNBcIs1PU6p+tF0r bp7k4SBOPao66C3nJMwiYYYWcWQPZ8pd2jouhYylWxrYKyvtO6IO3B8wspvUELCIIM ELM/E5eFiWPMvI1sgd5us3M072bRK+d9bFfSX6W+sipIBjm/hmjQowRsvaztFKO0CG ufJK/A0sPZnvez8ABVT5PU3J0s7/PTBwRY0KCX/9JPytZ4k523p0A5EXSAQWduYrqZ N1D+2k433TsYQ== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 2/3] mm/vma: remove mmap_action->success_hook Date: Fri, 22 May 2026 17:00:10 +0100 Message-ID: <2521c19866f3f10f9085d094cc4f06769042be71.1779462249.git.ljs@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This hook was introduced to work around code that seemed to absolutely require access to a VMA pointer upon mmap(). However, providing this hook leaves a backdoor to drivers getting access to the very thing mmap_prepare eliminates - a pointer to the VMA. Let's solve this contradiction by removing it. The key intended user was hugetlb, however it seems that the best course now is to avoid allowing all drivers the ability to work around mmap_prepare, and find a different solution there. Signed-off-by: Lorenzo Stoakes --- include/linux/mm_types.h | 10 ---------- mm/util.c | 2 -- tools/testing/vma/include/dup.h | 10 ---------- 3 files changed, 22 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a308e2c23b82..945c0a5386d6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -843,16 +843,6 @@ struct mmap_action { }; enum mmap_action_type type; =20 - /* - * If specified, this hook is invoked after the selected action has been - * successfully completed. Note that the VMA write lock still held. - * - * The absolute minimum ought to be done here. - * - * Returns 0 on success, or an error code. - */ - int (*success_hook)(const struct vm_area_struct *vma); - /* * If specified, this hook is invoked when an error occurred when * attempting the selected action. diff --git a/mm/util.c b/mm/util.c index 2b2a9df689d7..4e172990afcd 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1397,8 +1397,6 @@ static int mmap_action_finish(struct vm_area_struct *= vma, =20 if (!err) err =3D call_vma_mapped(vma); - if (!err && action->success_hook) - err =3D action->success_hook(vma); =20 /* do_munmap() might take rmap lock, so release if held. */ maybe_rmap_unlock_action(vma, action); diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index 306171d061e7..fddfd1b57c09 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -482,16 +482,6 @@ struct mmap_action { }; enum mmap_action_type type; =20 - /* - * If specified, this hook is invoked after the selected action has been - * successfully completed. Note that the VMA write lock still held. - * - * The absolute minimum ought to be done here. - * - * Returns 0 on success, or an error code. - */ - int (*success_hook)(const struct vm_area_struct *vma); - /* * If specified, this hook is invoked when an error occurred when * attempting the selection action. --=20 2.54.0 From nobody Sun May 24 20:33:11 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39AB230EF90 for ; Fri, 22 May 2026 16:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465625; cv=none; b=iuYTKDdRy2GVDSxLO5Wtu/pmB3/2vLgdKQRyHTYC67bURuy2eDMy5h4iqcomeuDroxAJps6khWoPD/K0M+op8hSNIBGteYWf+zo6QsAy65+ZX7wMU1EGouicigCJqXnOTKgTENydESVFADbkeEomEf2kGoW0Ehb27WRpBgUdoWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779465625; c=relaxed/simple; bh=0MeNjHSMwHnl43ZnJr7lANquz7kQAjnacczqJ72j1rA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P+8U4fVrGIJjLTh67cGFE9qu9nqSqX9QkP7uouU8DyfEOIhjOroQlbJb48enZ2MVMy2rha8A5F3144F2O0aP5/Gzcs12sn0F9vWNt4Cm1KLpXysufC5MmGnQFGHh2cuhQ/wip6HLQ1+aek19Fm2rr7yx3v4EMtzZ/7DvVWsoEqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aHQW+4zp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aHQW+4zp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4249D1F00A3D; Fri, 22 May 2026 16:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779465623; bh=316RJj3nC9oY2FUmt7SPv6BDYnUsOE3VTbuP2TV/Ess=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aHQW+4zp4Ue8xoxOd05U7Jt/Y2i2slzBpf2CQ1ORoAad8i7w9ZQU29LvdVg7Mt4ym HlN43tUOzQxvRhXfBTuhVKnY6kMoZgR36LpiKoNT+Sc2MTFHQuUVm4wfoB7J7zAdKr 9wNTfKvz0gnfcKwuqecKaDhLKnq96mZS1xb/JJhCGECEcTTYnWjcEipnLd7jsC7ldz mhgsA+1oQI7sZnGQndk/YjfGgr1sKZ8/CHfnfaPFqgoteq55Udg1YtJjWQ0wuVNLMz myMa97/dN7g/i1JFfq35hneSFMuZnoDSuRSrEWkRRcS6bfNlEjdIvqN97fN52YtVtJ RWRDJAO4QQmPA== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 3/3] mm/vma: eliminate mmap_action->error_hook, introduce error_filter Date: Fri, 22 May 2026 17:00:11 +0100 Message-ID: X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rather than providing a hook, simplify things by providing the ability to filter errors. This allows us to more carefully validate the value provided and thus ensure only a valid error code is specified, and simplifies the interface. This way, we eliminate all hooks but mmap_prepare and allow only mmap actions to be specified (which core mm controls). This significantly improves robustness and eliminates any unnecessary code duplication in driver mmap hooks. We also update the /dev/mem logic (the only user) to use mmap_action->error_filter instead. Signed-off-by: Lorenzo Stoakes --- drivers/char/mem.c | 8 +------- include/linux/mm_types.h | 9 +++------ mm/util.c | 29 +++++++++++++++++++++-------- tools/testing/vma/include/dup.h | 9 +++------ 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index a4297eb39887..11639d988e47 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -322,11 +322,6 @@ static const struct vm_operations_struct mmap_mem_ops = =3D { #endif }; =20 -static int mmap_filter_error(int err) -{ - return -EAGAIN; -} - static int mmap_mem_prepare(struct vm_area_desc *desc) { struct file *file =3D desc->file; @@ -362,8 +357,7 @@ static int mmap_mem_prepare(struct vm_area_desc *desc) =20 /* Remap-pfn-range will mark the range with the I/O flag. */ mmap_action_remap_full(desc, desc->pgoff); - /* We filter remap errors to -EAGAIN. */ - desc->action.error_hook =3D mmap_filter_error; + desc->action.error_filter =3D -EAGAIN; =20 return 0; } diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 945c0a5386d6..8d1fb85e7684 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -844,13 +844,10 @@ struct mmap_action { enum mmap_action_type type; =20 /* - * If specified, this hook is invoked when an error occurred when - * attempting the selected action. - * - * The hook can return an error code in order to filter the error, but - * it is not valid to clear the error here. + * If non-zero, filter errors that arise from mmap actions such that we + * return error_filter instead. Only valid error codes may be specified. */ - int (*error_hook)(int err); + int error_filter; =20 /* * This should be set in rare instances where the operation required diff --git a/mm/util.c b/mm/util.c index 4e172990afcd..9b4e5432d45a 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1414,16 +1414,22 @@ static int mmap_action_finish(struct vm_area_struct= *vma, */ len =3D vma_pages(vma) << PAGE_SHIFT; do_munmap(current->mm, vma->vm_start, len, NULL); - if (action->error_hook) { - /* We may want to filter the error. */ - err =3D action->error_hook(err); - /* The caller should not clear the error. */ - VM_WARN_ON_ONCE(!err); - } - return err; + + return action->error_filter ?: err; } =20 #ifdef CONFIG_MMU + +static int check_mmap_action(struct mmap_action *action) +{ + const unsigned long filter =3D action->error_filter; + + if (WARN_ON_ONCE(filter && !IS_ERR_VALUE(filter))) + return -EINVAL; + + return 0; +} + /** * mmap_action_prepare - Perform preparatory setup for an VMA descriptor * action which need to be performed. @@ -1433,7 +1439,14 @@ static int mmap_action_finish(struct vm_area_struct = *vma, */ int mmap_action_prepare(struct vm_area_desc *desc) { - switch (desc->action.type) { + struct mmap_action *action =3D &desc->action; + int err; + + err =3D check_mmap_action(action); + if (err) + return err; + + switch (action->type) { case MMAP_NOTHING: return 0; case MMAP_REMAP_PFN: diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index fddfd1b57c09..bcd569a72087 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -483,13 +483,10 @@ struct mmap_action { enum mmap_action_type type; =20 /* - * If specified, this hook is invoked when an error occurred when - * attempting the selection action. - * - * The hook can return an error code in order to filter the error, but - * it is not valid to clear the error here. + * If non-zero, filter errors that arise from mmap actions such that we + * return error_filter instead. Only valid error codes may be specified. */ - int (*error_hook)(int err); + int error_filter; =20 /* * This should be set in rare instances where the operation required --=20 2.54.0