linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tzsz <writing.segfaults@gmail.com>
To: linux-fsdevel@vger.kernel.org
Subject: Swapping fs root inode without unmounting
Date: Fri, 7 Mar 2025 16:39:21 +0100	[thread overview]
Message-ID: <51d24177-482e-4355-8e14-689752dfa36e@gmail.com> (raw)

Hello!

We are currently developing a snapshot feature for a small university 
project. And for this reason we are looking for a way to swap out the 
root inode of our (mounted) fs.
Internally we have a set of root inodes and we'd like to swap them out 
at will without unmounting the entire filesystem.

Is there any function/way how to do this properly?

So far we tried the following:
  -> swapping dentry: setting sb->s_root
     -> causes a lot of problems regarding inode ref counting (I_CLEAR flag)
  -> looking into fs_context (doesnt seem like this is appropriate here)
  -> we did not find anything related within the vfs.rst docs

Furthermore, we cannot mount those other root inodes at different 
mountpoints. All changes have to be live and in-place.

Kind regards


             reply	other threads:[~2025-03-07 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 15:39 tzsz [this message]
2025-03-10  8:04 ` Swapping fs root inode without unmounting Christian Brauner

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=51d24177-482e-4355-8e14-689752dfa36e@gmail.com \
    --to=writing.segfaults@gmail.com \
    --cc=linux-fsdevel@vger.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;
as well as URLs for NNTP newsgroup(s).