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 33A7A3BC66D for ; Tue, 21 Apr 2026 10:33:49 +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=1776767630; cv=none; b=beOLAA3o6ygJij0ckcO8E4JXsbkyvazusYxOq2S4oy6YEVX5qb+IOJnhZFFE7rgNGyoNubzmhx2LbSVBFLDn00B4xEYVa/ws89ywWuDE7uB7mMF7h61m6oNF05mP/Mjq9Eyb1zvDQIU4e/hjxcfoMsGasF+5LxJFpLaMrqdoGhQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776767630; c=relaxed/simple; bh=+HYxyzzmrs8BA0f4ocV88SQtOQuD4Dh2f+8I1JsB5Pg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kwHHW2wYACjNtUUWksmWyuKkAb4ptQpoujtsbRcpJ4uunI2rImV8cA7kSbk5DnapIOmSLIUixm7ucsX8yoUNcoo69ngtQ52u0mrgEwBUyO51vaM/6vN2lwzD5d9d1qYqotyJH/Ka/eCEAcpQ4scFr9wD1TTENL2dNPPJJzdmDJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PiaYdB/6; 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="PiaYdB/6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A342FC2BCB5; Tue, 21 Apr 2026 10:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776767629; bh=+HYxyzzmrs8BA0f4ocV88SQtOQuD4Dh2f+8I1JsB5Pg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PiaYdB/6a+Mmpo8s7JnI43D9v3kTtg0YWl0Ywx4jNX47uPO7NvVs5caHtJ8loMX40 QOP77tYBVIbUSxtHmAxPxkndq0Ai65F3GhP+7CBZ5aFRfi2gfdD7PuJFZZzeUg1npd UcDZQjCzpEmieEiD/2DcrBZyExhMwVlRaDykIK4JIJESnesyofEMn8AaLYuc7PyMEy HAuoPdFF4llpLEBFvlYKjSeki9rMcMlMVsDdGmZsspdA/dsPzZmVwzwf0KMORHs2b7 WjjyWbBfckfkdfVZh7b1KDCNp7xVMk3R9vi8RgWDFZFjrX5mEQRUf31A/ro5cUvLnS CUtQpY8UDsWhw== Date: Tue, 21 Apr 2026 13:33:43 +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 3/6] liveupdate: add LUO_SESSION_MAGIC magic inode type Message-ID: References: <20260420141741.2688371-1-luca.boccassi@gmail.com> <20260420141741.2688371-4-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-4-luca.boccassi@gmail.com> On Mon, Apr 20, 2026 at 03:15:11PM +0100, luca.boccassi@gmail.com wrote: > From: Luca Boccassi > > In userspace when managing LUO sessions we want to be able to identify > a FD as a LUO session, in order to be able to do the special handling > that they require in order to function as intended on kexec. > > Currently this requires scraping procfs and doing string matching on > the prefix of the dname, which is not an ideal interface. > > Add a singleton inode type with a magic value, so that we can > programmatically identify a fd as a LUO session via fstatfs(). > > Signed-off-by: Luca Boccassi > Reviewed-by: Pasha Tatashin > --- > include/uapi/linux/magic.h | 1 + > kernel/liveupdate/luo_core.c | 10 +++- > kernel/liveupdate/luo_internal.h | 2 + > kernel/liveupdate/luo_session.c | 91 ++++++++++++++++++++++++++++++-- > 4 files changed, 98 insertions(+), 6 deletions(-) > > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h > index 4f2da935a76c..4f51005522ff 100644 > --- a/include/uapi/linux/magic.h > +++ b/include/uapi/linux/magic.h > @@ -105,5 +105,6 @@ > #define PID_FS_MAGIC 0x50494446 /* "PIDF" */ > #define GUEST_MEMFD_MAGIC 0x474d454d /* "GMEM" */ > #define NULL_FS_MAGIC 0x4E554C4C /* "NULL" */ > +#define LUO_SESSION_MAGIC 0x4c554f53 /* "LUOS" */ > > #endif /* __LINUX_MAGIC_H__ */ > diff --git a/kernel/liveupdate/luo_core.c b/kernel/liveupdate/luo_core.c > index dda7bb57d421..f1a63ebe4fa4 100644 > --- a/kernel/liveupdate/luo_core.c > +++ b/kernel/liveupdate/luo_core.c > @@ -197,9 +197,17 @@ static int __init luo_late_startup(void) > if (!liveupdate_enabled()) > return 0; > > + err = luo_session_fs_init(); > + if (err) { > + luo_global.enabled = false; Please use goto here and on luo_fdt_setup() failure to handle cleanup on error. Other than that Acked-by: Mike Rapoport (Microsoft) > + return err; > + } > + > err = luo_fdt_setup(); > - if (err) > + if (err) { > + luo_session_fs_cleanup(); > luo_global.enabled = false; > + } > > return err; > } -- Sincerely yours, Mike.