From nobody Mon Feb 9 12:24:26 2026 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 CD3DA394478 for ; Wed, 7 Jan 2026 15:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800062; cv=none; b=d2Bf5eyTIZyby29cmtCTR+lCj/Eat0Z4ajyqUB/CaFnA1Re6hez4yruned7/OaZzMwcB5Xjx5MKB1kSeMtvBhh7xkXCAjp1gEUciB0k0SedXcHNHrPwBAcIMedFaEaCt4NAcvtAPuW60Wc1xcjDrQN6kZrk3vjxX1aPT4wh5Jeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800062; c=relaxed/simple; bh=eVZvTKoGzS9QT9AZIVcrZZeY/VZ69Zoen8NpofDAoxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZuILTV80ZniDPNMsVGuHa+cW5GoCzx+/7C4et7oBv9GZ5QZPYqGNOWCx498NHw8gUUJfZeSPcaqnPnTDM09krrmxjITEW43O3XMGDZrP0NKKa3IcVFjNmj+ifFdkVtrOtpfSE5ZvTBiA0H7xuK2iQLfxmbQpF38sXo3CHC4hkq0= 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=UGnvaW4c; arc=none smtp.client-ip=209.85.167.176 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="UGnvaW4c" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-457c1148a5bso824438b6e.1 for ; Wed, 07 Jan 2026 07:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800058; x=1768404858; 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=ioRMhdbsJjC8v5pL1MPtuv/dIU5BMDQOIZe20AJ80PY=; b=UGnvaW4co7XWirS/NsFr1WBKa5z2Yg9k29ztmMLr5Rh/iwNkIUZL4MInE1Up1WNYnW aPUBxfiPAQKzdu6D3XZqWtIgv0nFhLt7zkU0skIarPSJfgfs7sRT3OcAc4/msmER1vwP 47RlqOdzGLN1YjCTUU93/CpkZ744c7B56s/pkPPNqJaXDqqUbZ/9z3Ne6mleRmUEzmDX 3f6jVFR3WhI1Z7wKs6kYbBYivQBju0sMlu8VfUGcIztrovsgk2PPJXQM8xrZNH8bNyly cuehlgEs8bzW+/b2Zyb0ceXGiAKsqoVTZjcm0iOMRNAfN9dBExhRnWBygUgbmV2Xzi7Q gViA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800058; x=1768404858; 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=ioRMhdbsJjC8v5pL1MPtuv/dIU5BMDQOIZe20AJ80PY=; b=Pr4e6vV3t9eQAHoBIUdmPYvGZgUcqc8PRMFc9yDYt9kZ4YuASIyXtUqh7rFVQ9MjC5 MOjhUCVqLfjcQus2w38GOyvMV9GzPZ68gDhLrdk8AO3KzlwY5+kPtcZe4gBO6j63kxOc CZMATl/aXTQ7EyPhPL78MDeiKP8tc1ADrdhrIUhlnMVDerJvZgQAk/nE7FYQM3xPZWdP Q1UgGC7C0PuUHB51gfECOVVzBhqrs4WxkyYqJmmEg6+TtqtHUwwJArmvSMqB/c28EO5u rbhAFjb7k/uptvp0Oqbk3epwFZ8abqNFMlNcRknwtUsFF9l7jXNIo5DRoJnYMzMcJ9Xp n76A== X-Forwarded-Encrypted: i=1; AJvYcCUP1sFdVnt+3hdpgADa5OW8psjgYU5xyiaF5mAnkYkdxG4V4UHSpyRaYRq0DTjxidZlWxKMBn8FXLoRwgg=@vger.kernel.org X-Gm-Message-State: AOJu0YyYD9CY294jhkGPqhTDWDqnWtDYuvZDbxT0UmrcesCGLRg1/F7E YPILIWadKJUs2GCO6J7BZpYWsqGCqnM2c2AfUcbsdhbSAUwgES8VKJw0 X-Gm-Gg: AY/fxX5pIeTTLGDgJp1ltAgUfjsw0vfHuwA4+mkhw/uHTC/JmHE0UXjx+yw/89ZrCF2 42YIsTfVmS4oC+iIJhTrjVoNL8Zgm3viAzrLGqOgrllUZgw0UXw9T6Kxd+8LoDdDwpu8hGIlBHE 9/fr2qir4C6iSfI9RFgRxwbmGz2ZGuIpE8xuz2qhaLlDv7yymVFElFL2dfnyibATRHUCgtCHaRw GyPPTMOmAhbOmr7DINM8+6BZ3GDPuqm75K7alKE9Rbx6ULTV+SyRImKwVA7MLJdi62HmBQKtkFG 03MAH6V/iArimA95/JOhRRFeyUWdoP9q4jmBygtt9mRtUo1GSzMo5Z894DMbXOx8gsNLXSnX4/J sb4IUrctCJrMaJn1F7Z49+6ZaLtjG06WJhRsMKU9jd4XGvgoFg/mtmvqkHSQsK1UvYM03XRzvVC Lvi+oGH1SY2V4kJdiZO0Imi9qx0zOZgegRWUZEayIRO39Z X-Google-Smtp-Source: AGHT+IG/OP1ZeA8RVwGBd2hiwLTF8z2bJWxQ5Kax1EN4BvyeAQ3tR8TZf8cyaewyY/AtJiZ/nDb6hw== X-Received: by 2002:a05:6808:3442:b0:453:f62:dddc with SMTP id 5614622812f47-45a6bccd815mr1304391b6e.7.1767800058505; Wed, 07 Jan 2026 07:34:18 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e2f1de5sm2398106b6e.22.2026.01.07.07.34.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:18 -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 13/21] famfs_fuse: Famfs mount opt: -o shadow= Date: Wed, 7 Jan 2026 09:33:22 -0600 Message-ID: <20260107153332.64727-14-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153332.64727-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153332.64727-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" The shadow path is a (usually in tmpfs) file system area used by the famfs user space to communicate with the famfs fuse server. There is a minor dilemma that the user space tools must be able to resolve from a mount point path to a shadow path. Passing in the 'shadow=3D' argument at mount time causes the shadow path to be exposed via /proc/mounts, Solving this dilemma. The shadow path is not otherwise used in the kernel. Signed-off-by: John Groves --- fs/fuse/fuse_i.h | 25 ++++++++++++++++++++++++- fs/fuse/inode.c | 28 +++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index ec2446099010..84d0ee2a501d 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -620,9 +620,11 @@ struct fuse_fs_context { unsigned int blksize; const char *subtype; =20 - /* DAX device, may be NULL */ + /* DAX device for virtiofs, may be NULL */ struct dax_device *dax_dev; =20 + const char *shadow; /* famfs - null if not famfs */ + /* fuse_dev pointer to fill in, should contain NULL on entry */ void **fudptr; }; @@ -998,6 +1000,18 @@ struct fuse_conn { /* Request timeout (in jiffies). 0 =3D no timeout */ unsigned int req_timeout; } timeout; + + /* + * This is a workaround until fuse uses iomap for reads. + * For fuseblk servers, this represents the blocksize passed in at + * mount time and for regular fuse servers, this is equivalent to + * inode->i_blkbits. + */ + u8 blkbits; + +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + char *shadow; +#endif }; =20 /* @@ -1631,4 +1645,13 @@ extern void fuse_sysctl_unregister(void); #define fuse_sysctl_unregister() do { } while (0) #endif /* CONFIG_SYSCTL */ =20 +/* famfs.c */ + +static inline void famfs_teardown(struct fuse_conn *fc) +{ +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + kfree(fc->shadow); +#endif +} + #endif /* _FS_FUSE_I_H */ diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index acabf92a11f8..2e0844aabbae 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -783,6 +783,9 @@ enum { OPT_ALLOW_OTHER, OPT_MAX_READ, OPT_BLKSIZE, +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + OPT_SHADOW, +#endif OPT_ERR }; =20 @@ -797,6 +800,9 @@ static const struct fs_parameter_spec fuse_fs_parameter= s[] =3D { fsparam_u32 ("max_read", OPT_MAX_READ), fsparam_u32 ("blksize", OPT_BLKSIZE), fsparam_string ("subtype", OPT_SUBTYPE), +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + fsparam_string("shadow", OPT_SHADOW), +#endif {} }; =20 @@ -892,6 +898,15 @@ static int fuse_parse_param(struct fs_context *fsc, st= ruct fs_parameter *param) ctx->blksize =3D result.uint_32; break; =20 +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + case OPT_SHADOW: + if (ctx->shadow) + return invalfc(fsc, "Multiple shadows specified"); + ctx->shadow =3D param->string; + param->string =3D NULL; + break; +#endif + default: return -EINVAL; } @@ -905,6 +920,7 @@ static void fuse_free_fsc(struct fs_context *fsc) =20 if (ctx) { kfree(ctx->subtype); + kfree(ctx->shadow); kfree(ctx); } } @@ -936,7 +952,10 @@ static int fuse_show_options(struct seq_file *m, struc= t dentry *root) else if (fc->dax_mode =3D=3D FUSE_DAX_INODE_USER) seq_puts(m, ",dax=3Dinode"); #endif - +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + if (fc->shadow) + seq_printf(m, ",shadow=3D%s", fc->shadow); +#endif return 0; } =20 @@ -1041,6 +1060,8 @@ void fuse_conn_put(struct fuse_conn *fc) WARN_ON(atomic_read(&bucket->count) !=3D 1); kfree(bucket); } + famfs_teardown(fc); + if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH)) fuse_backing_files_free(fc); call_rcu(&fc->rcu, delayed_release); @@ -1916,6 +1937,11 @@ int fuse_fill_super_common(struct super_block *sb, s= truct fuse_fs_context *ctx) *ctx->fudptr =3D fud; wake_up_all(&fuse_dev_waitq); } + +#if IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) + fc->shadow =3D kstrdup(ctx->shadow, GFP_KERNEL); +#endif + mutex_unlock(&fuse_mutex); return 0; =20 --=20 2.49.0