All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] erofs: enable SB_I_ALLOW_HSM to support fanotify pre access event
@ 2026-10-10  9:40 Friendy Su
  2026-10-10 21:20 ` Gao Xiang
  0 siblings, 1 reply; 6+ messages in thread
From: Friendy Su @ 2026-10-10  9:40 UTC (permalink / raw)
  To: xiang, chao
  Cc: linux-erofs, linux-kernel, Friendy Su, Yuezhang Mo, Daniel Palmer

This patch makes erofs support a use case below:

erofs file data are not available at local, but need be
filled at fanotify pre access event handler.

E.g. when format erofs to blob mode, meta data image
is store locally, blob image size is big so it is stored remotely.
At erofs mount, a loop device based on a sparse image file is
used as blob device. The sparse image file size is equal to blob
image size. Like:

$ sudo mount -o device=/dev/loop1 /dev/sdb1 /mnt/erofs/

Then at file access, need retrieve data from remote, then fill
into sparse image at FAN_PRE_ACCESS event handler.

Signed-off-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Daniel Palmer <daniel.palmer@sony.com>
---
 fs/erofs/super.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 0967aace9f7f..b92d3353319d 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -659,6 +659,10 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_maxbytes = MAX_LFS_FILESIZE;
 	sb->s_op = &erofs_sops;
 
+	/*
+	 * Allow HSM to support fanotify pre access event
+	 */
+	sb->s_iflags |= SB_I_ALLOW_HSM;
 	if (!sbi->domain_id && test_opt(&sbi->opt, INODE_SHARE)) {
 		errorfc(fc, "domain_id is needed when inode_share is on");
 		return -EINVAL;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-21  9:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10  9:40 [PATCH v1] erofs: enable SB_I_ALLOW_HSM to support fanotify pre access event Friendy Su
2026-10-10 21:20 ` Gao Xiang
2026-10-21  7:18   ` Friendy.Su
2026-10-21  8:05     ` Gao Xiang
2026-10-21  8:43       ` Friendy.Su
2026-10-21  9:42         ` Amir Goldstein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.