From nobody Sun Feb 8 20:29:02 2026 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09362398702 for ; Wed, 7 Jan 2026 15:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800099; cv=none; b=IsDndFIJ+qk62OSXmF3XdeWaNSUl3xQ89v1hyumM77ZkZ/EgKMeUbB3FT7gcFFlVLl0a6Tlmlr1wLR85zWCtVEFJXnhjdLewCMvLQHAFWFiLbeMzoQ91ZyMVH+XJtEgq23qUpNM3pPKIeqR/lkQoafDNhxElXA7tzcuVuYgTggs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800099; c=relaxed/simple; bh=3CO44iNrPAkdfYLxe1mcSvtJfmua9dBTiPyw/Zw6zgo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vEmmLkVqJWgw0E4bWKJAl2yPaIv6RvlcajhuLg1jtyz1iCWMJkvetJElGVU/sfDcWTMcoEFtLaFFwx4EizLZyk2dvjel7thSmMG6PeZcvhViUUTrD2jBpbtXBoqFr9UqDHR1Oc6PTpIuiwlsktOMRodQIzxiOpy7E5eBpe2Bz6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UlyzrF/X; arc=none smtp.client-ip=209.85.167.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UlyzrF/X" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-4510974a6bbso901928b6e.3 for ; Wed, 07 Jan 2026 07:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800097; x=1768404897; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=3n8Kb47Rl130Byxu0ad+8SvRWtkqSvh8ZeidUsu8Q2I=; b=UlyzrF/XmN05HA8PEjpbuqMKIxx6O8wSt2fCFJoABez6wlizZ79QjgpsYRx/PagwSv aFSZzo0XW7wjrLvKNUbPNWYGGdtU0/YPxOJbWREdy1/XecdFZNmiL85RnhW+HvdjT4uI WGo8FT0h1ziCxDr0ibrUqSNq9TnHnncITTFvgYI3O3d9nZhM9BB/0KvupT6d5TlNYykt 5auxcqE3iDkoH2Btc7JA9ecrgsh/VNTLoNfp3hFq1IQb70zhvXL2ixaTfkQr+/DMuhVj yl981S+hkIE3mf2MImnTIMl8GzQ0akcPzC+l5xu8jUWWIXH9OYGdiSLi8l8JOVvbY+cE P3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800097; x=1768404897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3n8Kb47Rl130Byxu0ad+8SvRWtkqSvh8ZeidUsu8Q2I=; b=q/4tP3HkYGAy77R9OFZG2dM7GzAUZNWFt6K9Osp/AHSHzuYyQLDd02kZ2d3DwYUHjG Ggzn7xPs/mfnbKqvEjFB2Nqg8wH8Dc7bDB95R8oBX3T91v4G6eh43FUOwLbA0Xj5TCPf 1B5rpk2tgphkVppheqZ40V/1bpTU2Bw2siEomeBBpzt/QcsxSLAYXsposJ9nMFV8blHD QBTwe00/VKxyjx7eUSsRolNbAZGH/Wl+cVYrng6VYOaQGGoGITqk5DpxFtYyoAsb+ur7 yMv2kloekUwoa5649X/yz68tJX07v6kICA6Vc7h87t/2lpAsI8+wi/dXZkHOxcQA5LGt WDmQ== X-Forwarded-Encrypted: i=1; AJvYcCXLI1QnuRIa5JdJktyKCQChZq2xR4EKRq+mEeWchy+B74lScXgDTYb9yn57NGriXpvH0Su0fRe2qnEsatw=@vger.kernel.org X-Gm-Message-State: AOJu0YzwA/UpZcg+RkH83BdsxiTyMjY4IkI9nKTnXiPvJjeVJ4rFMWdX N9YA/YYE1TEANBUfomS/XFFoUX02tilMcp2t1TKOwh5W0ayY4aNJ+DV9 X-Gm-Gg: AY/fxX7lVKqfCUPAVPw1DFWHUk3m5M/bfTkOuLxZOKhFr/1bgUN+iij4n6x2thLmKR8 oFbH27aNFAQTOx5u3ae4DqTxfB/+Grj5ozPkZhCZxqJ4oFZ5WeZvTi5mS3f07cV9Po4TyRHCd1U P+q4cX1NJmWpmsh0nHt1QG/HfvomaT4AfzCGEh7avotqu6jzPioP3nWM75D3ZFO4CojRqF7Fgc4 5H2TiLDT+L4MEzglumPxBRoiKAID3nVXyLSl0ULBBMm1ocJJanQKRiWDdJB1WOks/Q/iDz7b7IL kzMlH98PsLfGPKgMDUIpEbw+RNagKQcnMp7jkhw2VqL90ekqzu8SmS0AS530MbH6WG5Lraw2UVV YtGsgyVrMWuBdxbqO52RVibGJd2UjQlS0oW8DXkFOvCUqp/WgLYPCb6bTTGcXPjOyy3mtNuNGPj n/EAmK692ej+LflOzggW9tp1d97jDb/gu5PLlOUw7k4lba X-Google-Smtp-Source: AGHT+IEkv++nP1XZgFGglQlyqUlGW3kCUi7rPnay9ZMhKErbt4qPcz86yrkR1ubRTqfHLlOPMJj8bg== X-Received: by 2002:a05:6808:16a8:b0:45a:55e6:f5d6 with SMTP id 5614622812f47-45a6bd87897mr1217540b6e.12.1767800096765; Wed, 07 Jan 2026 07:34:56 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e183ac3sm2398424b6e.4.2026.01.07.07.34.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:56 -0800 (PST) Sender: John Groves From: John Groves X-Google-Original-From: John Groves To: John Groves , Miklos Szeredi , Dan Williams , Bernd Schubert , Alison Schofield Cc: John Groves , Jonathan Corbet , Vishal Verma , Dave Jiang , Matthew Wilcox , Jan Kara , Alexander Viro , David Hildenbrand , Christian Brauner , "Darrick J . Wong" , Randy Dunlap , Jeff Layton , Amir Goldstein , Jonathan Cameron , Stefan Hajnoczi , Joanne Koong , Josef Bacik , Bagas Sanjaya , Chen Linxuan , James Morse , Fuad Tabba , Sean Christopherson , Shivank Garg , Ackerley Tng , Gregory Price , Aravind Ramesh , Ajay Joshi , venkataravis@micron.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, John Groves Subject: [PATCH V3 3/4] fuse: add API to set kernel mount options Date: Wed, 7 Jan 2026 09:34:42 -0600 Message-ID: <20260107153443.64794-4-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153443.64794-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153443.64794-1-john@groves.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add fuse_add_kernel_mount_opt() to allow libfuse callers to pass additional mount options directly to the kernel. This enables filesystem-specific kernel mount options that aren't exposed through the standard libfuse mount option parsing. For example, famfs uses this to set the "shadow=3D" mount option for shadow file system mounts. API addition: int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_= opt) Signed-off-by: John Groves --- include/fuse_lowlevel.h | 10 ++++++++++ lib/fuse_i.h | 1 + lib/fuse_lowlevel.c | 5 +++++ lib/fuse_versionscript | 1 + lib/mount.c | 8 ++++++++ 5 files changed, 25 insertions(+) diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 016f831..d2bbcca 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -2195,6 +2195,16 @@ static inline int fuse_session_custom_io(struct fuse= _session *se, } #endif =20 +/** + * Allow a libfuse caller to directly add kernel mount opts + * + * @param se session object + * @param mount_opt the option to add + * + * @return 0 on success, -1 on failure + */ +int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_o= pt); + /** * Mount a FUSE file system. * diff --git a/lib/fuse_i.h b/lib/fuse_i.h index 65d2f68..41285d2 100644 --- a/lib/fuse_i.h +++ b/lib/fuse_i.h @@ -220,6 +220,7 @@ void destroy_mount_opts(struct mount_opts *mo); void fuse_mount_version(void); unsigned get_max_read(struct mount_opts *o); void fuse_kern_unmount(const char *mountpoint, int fd); +int __fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount= _opt); int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo); =20 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *io= v, diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 0cde3d4..413e7c3 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -4349,6 +4349,11 @@ int fuse_session_custom_io_30(struct fuse_session *s= e, offsetof(struct fuse_custom_io, clone_fd), fd); } =20 +int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_o= pt) +{ + return __fuse_add_kernel_mount_opt(se, mount_opt); +} + int fuse_session_mount(struct fuse_session *se, const char *_mountpoint) { int fd; diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index f9562b6..536569a 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -220,6 +220,7 @@ FUSE_3.18 { =20 fuse_reply_statx; fuse_fs_statx; + fuse_add_kernel_mount_opt; } FUSE_3.17; =20 FUSE_3.19 { diff --git a/lib/mount.c b/lib/mount.c index 7a856c1..e6c2305 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -674,6 +674,14 @@ void destroy_mount_opts(struct mount_opts *mo) free(mo); } =20 +int __fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount= _opt) +{ + if (!se->mo) + return -1; + if (!mount_opt) + return -1; + return fuse_opt_add_opt(&se->mo->kernel_opts, mount_opt); +} =20 int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo) { --=20 2.49.0