From: "Friendy.Su@sony.com" <Friendy.Su@sony.com>
To: "xiang@kernel.org" <xiang@kernel.org>,
"chao@kernel.org" <chao@kernel.org>,
"jack@suse.cz" <jack@suse.cz>,
"amir73il@gmail.com" <amir73il@gmail.com>
Cc: "linux-erofs@lists.ozlabs.org" <linux-erofs@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>,
"Daniel.Palmer@sony.com" <Daniel.Palmer@sony.com>
Subject: Re: [PATCH v2] erofs: set SB_I_ALLOW_HSM for bdev-based mounts
Date: Fri, 23 Oct 2026 02:32:21 +0000 [thread overview]
Message-ID: <TY0PR04MB6191A05CCB7E65F910A5B07DFD642@TY0PR04MB6191.apcprd04.prod.outlook.com> (raw)
In-Reply-To: <20261023021635.2852395-1-friendy.su@sony.com>
Hi, Gao
I will send patches for test in erofs-utils.
Best Regards
Friendy
________________________________________
From: Su, Friendy <Friendy.Su@sony.com>
Sent: Friday, October 23, 2026 10:16
To: xiang@kernel.org; chao@kernel.org; jack@suse.cz; amir73il@gmail.com
Cc: linux-erofs@lists.ozlabs.org; linux-kernel@vger.kernel.org; Su, Friendy; Mo, Yuezhang; Palmer, Daniel (SGC)
Subject: [PATCH v2] erofs: set SB_I_ALLOW_HSM for bdev-based mounts
SB_I_ALLOW_HSM makes erofs support fanotify FAN_PRE_ACCESS event
for bdev-based mounts. file-backed mounts do not support this.
This is for use case that erofs file data is not available on
local block device at mount, but need to be filled at fanotify
FAN_PRE_ACCESS event handler.
E.g. format erofs to blob mode, meta data on /dev/pmem0, file data
on blob device /dev/pmem1. The file content in blob device is dummy.
mount as below:
$ sudo mount -o dax,device=/dev/pmem1 /dev/pmem0 /mnt/erofs/
In FAN_PRE_ACCESS handler, actual file content is fetched from remote
then filled into the DAX mounted block device /dev/pmem1.
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 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 0967aace9f7f..be8728b8d116 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -667,6 +667,15 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
errorfc(fc, "FSDAX is not allowed when inode_share is on");
return -EINVAL;
}
+ if (!erofs_is_fileio_mode(sbi)) {
+ /*
+ * Only enable HSM to support fanotify FAN_PRE_ACCESS event
+ * under block device backed mounts.
+ * For file-backed mounts, do not enable since erofs-utils
+ * has already supported FAN_PRE_ACCESS event on backend image.
+ */
+ sb->s_iflags |= SB_I_ALLOW_HSM;
+ }
sbi->blkszbits = PAGE_SHIFT;
if (erofs_is_fileio_mode(sbi)) {
--
2.34.1
next prev parent reply other threads:[~2026-10-23 2:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 2:16 Friendy Su
2026-10-23 2:32 ` Friendy.Su [this message]
2026-11-19 21:40 ` Gao Xiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=TY0PR04MB6191A05CCB7E65F910A5B07DFD642@TY0PR04MB6191.apcprd04.prod.outlook.com \
--to=friendy.su@sony.com \
--cc=Daniel.Palmer@sony.com \
--cc=Yuezhang.Mo@sony.com \
--cc=amir73il@gmail.com \
--cc=chao@kernel.org \
--cc=jack@suse.cz \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®