From a9b3c9fff3fd65022e36810f9beccc0d6949659a Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:31 +0100 Subject: [PATCH] Revert "mount: handle OOM on mnt_warn_timestamp_expiry" This reverts commit 3e27e86884f70f2e8bcbb2e5a8a8e538c0fba595. --- fs/namespace.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index d28263079..369ea869c 100755 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2892,15 +2892,8 @@ static void mnt_warn_timestamp_expiry(struct path *mountpoint, struct vfsmount * if (!__mnt_is_readonly(mnt) && (!(sb->s_iflags & SB_I_TS_EXPIRY_WARNED)) && (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) { - char *buf, *mntpath; - - buf = (char *)__get_free_page(GFP_KERNEL); - if (buf) - mntpath = d_path(mountpoint, buf, PAGE_SIZE); - else - mntpath = ERR_PTR(-ENOMEM); - if (IS_ERR(mntpath)) - mntpath = "(unknown)"; + char *buf = (char *)__get_free_page(GFP_KERNEL); + char *mntpath = buf ? d_path(mountpoint, buf, PAGE_SIZE) : ERR_PTR(-ENOMEM); pr_warn("%s filesystem being %s at %s supports timestamps until %ptTd (0x%llx)\n", sb->s_type->name, @@ -2908,9 +2901,8 @@ static void mnt_warn_timestamp_expiry(struct path *mountpoint, struct vfsmount * mntpath, &sb->s_time_max, (unsigned long long)sb->s_time_max); + free_page((unsigned long)buf); sb->s_iflags |= SB_I_TS_EXPIRY_WARNED; - if (buf) - free_page((unsigned long)buf); } }