[PATCH 14/17] fs/namespace: use __getname() to allocate mntpath buffer

From: Mike Rapoport (Microsoft)

Date: Sat May 23 2026 - 13:58:35 EST


mnt_warn_timestamp_expiry() allocates memory for a path with
__get_free_page() although there is a dedicated helper for allocation of
file paths: __getname().

Replace __get_free_page() for allocation of a path buffer with __getname().

Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
---
fs/namespace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index fe919abd2f01..2ed9cd846a81 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3303,7 +3303,7 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,
(ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) {
char *buf, *mntpath;

- buf = (char *)__get_free_page(GFP_KERNEL);
+ buf = __getname();
if (buf)
mntpath = d_path(mountpoint, buf, PAGE_SIZE);
else
@@ -3319,7 +3319,7 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,

sb->s_iflags |= SB_I_TS_EXPIRY_WARNED;
if (buf)
- free_page((unsigned long)buf);
+ __putname(buf);
}
}


--
2.53.0