On 4/4/24 8:21 PM, Eric Sandeen wrote: > So the oops you hit is when a snapshot is mounted first, then the main > fs is mounted. > > My patch does this: > > /* > * Try remount to setup mount states if the current > * tree is not mounted and only snapshots use this sb. > */ > err = nilfs_reconfigure(fc); > > (in place of nilfs_remount()), and nilfs_reconfigure expects to have > fc->root set, which is normally only set up for an actual remount. > > fc->root is NULL, so that's the oops. I'll see what I can work out. Not sure if this is a terrible hack, but your test script passes with this change on top of my original patch: diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 1cdc38db2612..4a9a8924068e 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1232,6 +1232,7 @@ nilfs_get_tree(struct fs_context *fc) * Try remount to setup mount states if the current * tree is not mounted and only snapshots use this sb. */ + fc->root = s->s_root; err = nilfs_reconfigure(fc); if (err) goto failed_super; -Eric