Commit 367f7a31 authored by Jan Koester's avatar Jan Koester
Browse files

ovl: allow UUID and GUID owners when the upper layer does

Changes to an overlay land in its upper layer, so whether the overlay
can store UUID and GUID owners is the upper layer's business: take
SB_I_UID_R over from it. Copy-up of such an owner from a lower layer
into an upper layer without the flag keeps failing with -EOVERFLOW.

This is what a live system with a tmpfs over a read-only image needs
to give files to UUID and GUID users.

Assisted-by: Claude:claude-opus-5-5
parent 56195155
Loading
Loading
Loading
Loading
+3 −0
Changes for fs/overlayfs/super.c: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1455,6 +1455,9 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)

		sb->s_stack_depth = upper_sb->s_stack_depth;
		sb->s_time_gran = upper_sb->s_time_gran;
		/* changes land in the upper layer: its kinds of owner */
		if (upper_sb->s_iflags & SB_I_UID_R)
			sb->s_iflags |= SB_I_UID_R;
	}
	oe = ovl_get_lowerstack(sb, ctx, ofs, layers);
	err = PTR_ERR(oe);