From 7731194090ab632fa58fa1e58a3996428c30d388 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Mon, 2 Nov 2020 18:45:43 +0000 Subject: [PATCH] linux(4): Quiesce unrecognized ioctl warning for F2FS query On Linux, sqlite probes for underlying F2FS filesystems that support certain kinds of atomic update with this ioctl. The expected result on non-F2FS filesystem (i.e., all FreeBSD filesystems) is any error value. Minimally implement the ioctl and avoid the warning message. (This shows up in Linux Chrome, which embeds sqlite.) Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27050 --- sys/compat/linux/linux_ioctl.c | 1 + sys/compat/linux/linux_ioctl.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 0f93a30bfd15..b454a4308bd7 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -3631,6 +3631,7 @@ linux_ioctl_fallback(struct thread *td, struct linux_ioctl_args *args) switch (args->cmd & 0xffff) { case LINUX_BTRFS_IOC_CLONE: + case LINUX_F2FS_IOC_GET_FEATURES: case LINUX_FS_IOC_FIEMAP: return (ENOTSUP); diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index 8669a5bec80a..4aaf1114ff39 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -707,6 +707,11 @@ #define LINUX_IOCTL_VIDEO2_MIN LINUX_VIDIOC_QUERYCAP #define LINUX_IOCTL_VIDEO2_MAX LINUX_VIDIOC_UNSUBSCRIBE_EVENT +#define LINUX_F2FS_IOC_GET_FEATURES 0xf50c /* 0x8004f50c */ + +#define LINUX_IOCTL_F2FS_MIN 0xf500 +#define LINUX_IOCTL_F2FS_MAX LINUX_F2FS_IOC_GET_FEATURES + /* * Our libusb(8) calls emulated within linux(4). */