Skip to content

Commit

Permalink
aufs: bugfix, fc->root may not be real root
Browse files Browse the repository at this point in the history
If the subdir in aufs is "bind" mounted and remount is issued,
fs_context gives us the bound non-root dentry as if it were root.
But aufs expects fc->root being always root.

See-also: sfjro/aufs-standalone#40
Signed-off-by: J. R. Okajima <[email protected]>
  • Loading branch information
sfjro committed Jun 24, 2024
1 parent f52c34d commit b9f7afc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/aufs/fsctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static int au_fsctx_reconfigure(struct fs_context *fc)

root = fc->root;
sb = root->d_sb;
root = sb->s_root; /* "bind"-mount may give us non-root */
AuDebugOn(!IS_ROOT(root));
err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
if (!err) {
di_write_lock_child(root);
Expand Down

0 comments on commit b9f7afc

Please sign in to comment.