Re: [PATCH v1] mount: handle OOM on mnt_warn_timestamp_expiry

From: Al Viro
Date: Tue Jul 30 2024 - 11:49:39 EST


On Tue, Jul 30, 2024 at 10:58:13AM +0200, Olaf Hering wrote:
> If no page could be allocated, an error pointer was used as format
> string in pr_warn.
>
> Rearrange the code to return early in case of OOM. Also add a check
> for the return value of d_path. The API of that function is not
> documented. It currently returns only ERR_PTR values, but may return
> also NULL in the future. Use PTR_ERR_OR_ZERO to cover both cases.

Don't use PTR_ERR_OR_ZERO. And don't mix ERR_PTR() and NULL for
error returns without a really good reason for that.

d_path() is *NOT* going to return NULL.

NAK in that form.