unlock_mount_hash();
 }
 
+static void mnt_warn_timestamp_expiry(struct path *mountpoint, struct vfsmount *mnt)
+{
+       struct super_block *sb = mnt->mnt_sb;
+
+       if (!__mnt_is_readonly(mnt) &&
+          (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) {
+               char *buf = (char *)__get_free_page(GFP_KERNEL);
+               char *mntpath = buf ? d_path(mountpoint, buf, PAGE_SIZE) : ERR_PTR(-ENOMEM);
+               struct tm tm;
+
+               time64_to_tm(sb->s_time_max, 0, &tm);
+
+               pr_warn("Mounted %s file system at %s supports timestamps until %04ld (0x%llx)\n",
+                       sb->s_type->name, mntpath,
+                       tm.tm_year+1900, (unsigned long long)sb->s_time_max);
+
+               free_page((unsigned long)buf);
+       }
+}
+
 /*
  * Handle reconfiguration of the mountpoint only without alteration of the
  * superblock it refers to.  This is triggered by specifying MS_REMOUNT|MS_BIND
        if (ret == 0)
                set_mount_attributes(mnt, mnt_flags);
        up_write(&sb->s_umount);
+
+       mnt_warn_timestamp_expiry(path, &mnt->mnt);
+
        return ret;
 }
 
                }
                up_write(&sb->s_umount);
        }
+
+       mnt_warn_timestamp_expiry(path, &mnt->mnt);
+
        put_fs_context(fc);
        return err;
 }
                return PTR_ERR(mnt);
 
        error = do_add_mount(real_mount(mnt), mountpoint, mnt_flags);
-       if (error < 0)
+       if (error < 0) {
                mntput(mnt);
+               return error;
+       }
+
+       mnt_warn_timestamp_expiry(mountpoint, mnt);
+
        return error;
 }