From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED3AC3A4505 for ; Tue, 21 Apr 2026 10:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776767652; cv=none; b=GCAmRu4DKhQlEHPF3OLtu/vediegwSdZRxF8hxND5kbW/+GGOpOTAzbzWiWRj6ez8I6ejHpxt52s6JrWVPyNksCwtHVJsehJ0cLWjlRDN5Z2UFGcM1l3CL0HD76zBthZ7E65eOPvTCmz6Ep6UAgcUFVQLv4A4zR4M1YDhBB9CCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776767652; c=relaxed/simple; bh=ohwc7f4xvLfkQrWbOMULG7DqY75uoI42N8YjYFEYjwA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AbfQGz5Wqi28O4VGLeGBl/SWVYkdH8To8ygyGRPpL88bc1IK+Jmh3yU1OU0/zPruyN2rWNJOCkRlBVFkULRb6p93/I0DwjxoPfT7ITw5tGI/WZ+MXxwp/o+vB5Tey/azAt5c8ayjfVI0GermaC6ej/TK5aZd+W+DMvittvjaqpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QNr3cg9e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QNr3cg9e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 585A9C2BCB0; Tue, 21 Apr 2026 10:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776767651; bh=ohwc7f4xvLfkQrWbOMULG7DqY75uoI42N8YjYFEYjwA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QNr3cg9eZIJCPpOfr3PFQwsan4XWF3084HZ1dnOQwDda2m94gnDjdXzMlCL89paI3 iuU0cx+rB0ztcu9+5GfUBWT9QJUz16ys29akaZEu6SAXsrfq7yFLiMi2opOt4zpUOv GmwGXRmErmI72VWdP/W/q34JAJbnHBcFRgGeJ9lP1AXXOQnFNBxa4o5fS1X3lAeEPP lEgqoyN6ob22X0EcKohnaAmJkWR4pcvdazKl091Q438nUXyr/aM1Q82bhbRUBpmwua O+W1WFR/gKCCs4y7+sdM1txK3R9PMa3uAPyZwRadgBQUZArycZpaY3E2xdnktDu0Nq BEtO4NGuD9RxQ== Date: Tue, 21 Apr 2026 13:34:04 +0300 From: Mike Rapoport To: luca.boccassi@gmail.com Cc: kexec@lists.infradead.org, linux-mm@kvack.org, graf@amazon.com, pasha.tatashin@soleen.com, pratyush@kernel.org, brauner@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 4/6] selftests/liveupdate: add test case for LUO_SESSION_MAGIC Message-ID: References: <20260420141741.2688371-1-luca.boccassi@gmail.com> <20260420141741.2688371-5-luca.boccassi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260420141741.2688371-5-luca.boccassi@gmail.com> On Mon, Apr 20, 2026 at 03:15:12PM +0100, luca.boccassi@gmail.com wrote: > From: Luca Boccassi > > Verify that fstat works as expected after the switch from anon_inode > to the new magic number. > > Signed-off-by: Luca Boccassi > Reviewed-by: Pasha Tatashin Acked-by: Mike Rapoport (Microsoft) > --- > .../testing/selftests/liveupdate/liveupdate.c | 40 +++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/tools/testing/selftests/liveupdate/liveupdate.c b/tools/testing/selftests/liveupdate/liveupdate.c > index f0a8e600c154..5e99af0cc6e9 100644 > --- a/tools/testing/selftests/liveupdate/liveupdate.c > +++ b/tools/testing/selftests/liveupdate/liveupdate.c > @@ -22,9 +22,12 @@ > #include > #include > #include > +#include > +#include > #include > > #include > +#include > > #include "../kselftest.h" > #include "../kselftest_harness.h" > @@ -387,4 +390,41 @@ TEST_F(liveupdate_device, create_session_empty_name) > EXPECT_EQ(session_fd, -EINVAL); > } > > +/* > + * Test Case: Session fstat > + * > + * Verifies that fstatfs() on a session file descriptor reports the > + * LUO_SESSION_MAGIC filesystem type, and that fstat() returns consistent > + * inode numbers across different sessions (shared singleton inode). > + */ > +TEST_F(liveupdate_device, session_fstat) > +{ > + int session_fd1, session_fd2; > + struct stat st1, st2; > + struct statfs sfs; > + > + self->fd1 = open(LIVEUPDATE_DEV, O_RDWR); > + if (self->fd1 < 0 && errno == ENOENT) > + SKIP(return, "%s does not exist", LIVEUPDATE_DEV); > + ASSERT_GE(self->fd1, 0); > + > + session_fd1 = create_session(self->fd1, "fstat-session-1"); > + ASSERT_GE(session_fd1, 0); > + > + session_fd2 = create_session(self->fd1, "fstat-session-2"); > + ASSERT_GE(session_fd2, 0); > + > + /* Verify the filesystem type is LUO_SESSION_MAGIC */ > + ASSERT_EQ(fstatfs(session_fd1, &sfs), 0); > + EXPECT_EQ(sfs.f_type, LUO_SESSION_MAGIC); > + > + /* Verify both sessions share the same inode number */ > + ASSERT_EQ(fstat(session_fd1, &st1), 0); > + ASSERT_EQ(fstat(session_fd2, &st2), 0); > + EXPECT_EQ(st1.st_ino, st2.st_ino); > + > + ASSERT_EQ(close(session_fd1), 0); > + ASSERT_EQ(close(session_fd2), 0); > +} > + > TEST_HARNESS_MAIN > -- > 2.47.3 > -- Sincerely yours, Mike.