From 997831548a7c76f22b70384e5bf5efc054b732d3 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Tue, 24 Sep 2024 16:19:18 +1000 Subject: [PATCH] Linux 6.12: FMODE_UNSIGNED_OFFSET is now FOP_UNSIGNED_OFFSET torvalds/linux@641bb4394f40 asserts that this is a static flag, not intended to be variable per-file, so it moves it to file_operations instead. We just change our check to follow. No configure check is necessary because FOP_UNSIGNED_OFFSET didn't exist before this commit, and FMODE_UNSIGNED_OFFSET flag is removed in the same commit, so there's no chance of a conflict. It's not clear to me that we need this check at all, as we never set this flag on our own files, and I can't see any way that our llseek handler could recieve a file from another filesystem. But, the whole zpl_llseek() has a number of opportunities for pleasing cleanup that are nothing to do with this change, so I'll leave that for a future change. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #16582 --- include/os/linux/kernel/linux/vfs_compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/os/linux/kernel/linux/vfs_compat.h b/include/os/linux/kernel/linux/vfs_compat.h index 075b9e111b10..b4767d1ece89 100644 --- a/include/os/linux/kernel/linux/vfs_compat.h +++ b/include/os/linux/kernel/linux/vfs_compat.h @@ -68,7 +68,11 @@ lseek_execute( loff_t offset, loff_t maxsize) { +#ifdef FMODE_UNSIGNED_OFFSET if (offset < 0 && !(filp->f_mode & FMODE_UNSIGNED_OFFSET)) +#else + if (offset < 0 && !(filp->f_op->fop_flags & FOP_UNSIGNED_OFFSET)) +#endif return (-EINVAL); if (offset > maxsize)