From: Josef Bacik <josef@toxicpanda.com>
To: Miklos Szeredi <miklos@szeredi.hu>,
Amir Goldstein <amir73il@gmail.com>,
Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Christoph Hellwig <hch@infradead.org>,
Chris Mason <mason@kernel.org>,
Chengguang Xu <cgxu519@mykernel.net>,
linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Chengguang Xu <charliecgxu@tencent.com>,
Josef Bacik <josef@toxicpanda.com>
Subject: [PATCH v4 2/8] ovl: setup overlayfs' private bdi
Date: Fri, 06 Nov 2026 13:36:44 +0000 [thread overview]
Message-ID: <20261106-b4-ovl-containerized-sync-v4-2-6ddde0b7dd8a@toxicpanda.com> (raw)
In-Reply-To: <20261106-b4-ovl-containerized-sync-v4-0-6ddde0b7dd8a@toxicpanda.com>
From: Chengguang Xu <charliecgxu@tencent.com>
Setup overlayfs' private bdi so that we can collect
overlayfs' own dirty inodes.
Signed-off-by: Chengguang Xu <charliecgxu@tencent.com>
[josef: only for an overlay that tracks dirty inodes]
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
fs/overlayfs/super.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 81da70fd53a6..22a8d4eb3b7c 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1490,6 +1490,16 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)
if (!ofs->workdir)
sb->s_flags |= SB_RDONLY;
+ /*
+ * Dirty overlay inodes go on the lists of this bdi. fsync_mode
+ * is final once ovl_get_workdir() has returned.
+ */
+ if (ovl_tracks_dirty(ofs)) {
+ err = super_setup_bdi(sb);
+ if (err)
+ return err;
+ }
+
sb->s_stack_depth = upper_sb->s_stack_depth;
sb->s_time_gran = upper_sb->s_time_gran;
}
--
2.55.0
next prev parent reply other threads:[~2026-11-06 13:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 13:36 [PATCH v4 0/8] ovl: only sync what was written through the overlay Josef Bacik
2026-11-06 13:36 ` [PATCH v4 1/8] ovl: expand fsync mount options Josef Bacik
2026-11-06 13:36 ` Josef Bacik [this message]
2026-11-06 13:36 ` [PATCH v4 3/8] ovl: make the root inode appear hashed Josef Bacik
2026-11-06 13:36 ` [PATCH v4 4/8] ovl: mark the overlay inode dirty on modification Josef Bacik
2026-11-06 13:36 ` [PATCH v4 5/8] ovl: implement overlayfs' own ->write_inode operation Josef Bacik
2026-11-06 13:36 ` [PATCH v4 6/8] ovl: cache dirty overlayfs' inode Josef Bacik
2026-11-06 13:36 ` [PATCH v4 7/8] ovl: handle lazytime on the upper filesystem Josef Bacik
2026-11-06 13:36 ` [PATCH v4 8/8] ovl: implement containerized syncfs for overlayfs Josef Bacik
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=20261106-b4-ovl-containerized-sync-v4-2-6ddde0b7dd8a@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=cgxu519@mykernel.net \
--cc=charliecgxu@tencent.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=mason@kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/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®