From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B7581FC7C5 for ; Sun, 14 Jun 2026 12:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781441304; cv=none; b=OsEcrn7GBMldBNFqQZB1MdLyin9I3bhJ+DpzXh6cQtc+szebWZrWmkhO1+63cIYzb3kHpJ/eX9ugWe9XBHlfVTIjCac0PSevWMeVs8vOx+5kginIWbqHbGX2AeOCgNr8zxNhtcfuhj7cxaEVGGLyvL3LpEwA6murlnPWXtkaLHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781441304; c=relaxed/simple; bh=0fzOSZjb7+WNFss0MQCoTxpYdoKewRSULf09aHuwd5c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cuIHUEgh8P91lggnqciBGHdNuaOG9tF+2/aFubw0aXcey4XbJwJ9IZO4JucAGBV/cRZrrqHG/2RQnncniqGemTUI+8Q7lqt2USoUtUTY8tJ2LyHkGCju/SwNOklsyWcmh2WhfjNCCVCpiOwkkFGx3HqVwPUz4xFDDCHRKo6k74I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CZ3BILd+; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CZ3BILd+" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2bf22c18ad3so105365ad.0 for ; Sun, 14 Jun 2026 05:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781441303; x=1782046103; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GiuA0JHLa9l58ogicvE0m7CrCNTFlFcY4pqZqBKpS2I=; b=CZ3BILd+fFG/Ug12ZmwCidiBwmWAKqAh4b6Bqkq2H6lojh9fmVqW3IiGoU4OgETUEc U7AvLrxJaVHbI7q6LZ6sEJFDf20PCW69hJuqP1tpd3hvPBXp3WwNSFDYGuFVyOZXnJLs +jmzdIO0THAo7v9+L06+H0sghrhHIJEWaQ+TVu2FmCHULbnau2dQFXXTgDaB6yS+C0K3 +WiRcOWzTeOaXPHurSO0FULtmgqRVBfQgz/8r/7qqPCdgA6nntgg9DH3mMhC7I//RzU9 e/2wdT/GURM1tlSNbEldAY3joiWwUJcWMEXH3Yj/uN2VLnugfx7/8P8nBsmGyMGnfQ7r ax7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781441303; x=1782046103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GiuA0JHLa9l58ogicvE0m7CrCNTFlFcY4pqZqBKpS2I=; b=m8EyYiC17C1STuaV0YotUOg6cceOLWyI6UR7QIX67XJoYBCo8WfvmcQnLqDnCclRKS UOJw+wA2CzAm3Vlwa1PUK40gdSbxOWMMwu0flKlKCohs6MELagGs6Huj0xYCynsPNl/M 9dTBu+OXU4r36N2eiYARsuU9Hf9xTXPhlOn55D9AwXayA4IJvNPgEaBk8dbHc/d85qv1 eEy33Hd0S4ycJ6eui7c9cAm/UrwAYkPIo2+O4IY0mJwXjeeE5+24XSW9EitfPyKvQ7R6 8aThicN+CQ6wEUEy33Y0QQpe20i5DzpFU/ogCRw+VbrhnXj50yJba9XHFTNg5mF17YXC JRlg== X-Forwarded-Encrypted: i=1; AFNElJ+2yms1S4HkRZwD3Lu5qnf29za2i6WdI6ZHI9l6Yp5+OPYKveHa4HLdXUhgVHsSdXJiP+RBzdWZXunGD20=@vger.kernel.org X-Gm-Message-State: AOJu0YzzFg5TxFcwmVGqjBFbseMwTQVae/lhQ1uV2vmDeX7qJ51hH9hT Li8bLes15kRCmVtgD/EEmvagZS/gk2BRmjzz0DrHL1ulJjZxrYcV8vuqe0lLQM1ViA== X-Gm-Gg: Acq92OEddnXkKGreaU5TgSmfBsmRCvVrvvhBaoKktZi/sJAvJe4lbrB7gRS6WblyMt1 cipE6M4E/1hfd+sgq139xfLvGeFFV1hecDWT0aV3TtmJylL9OacH1EG3P8jaDiggpJCNFKee34L /krLuTsrdT3TNNFgbu5dboZGawBUhB51AtCTuGNHhFWhoL6s0AnHyubIGZYMSiBvBqo9bKsA/vF mu8aefXI7O1n+7SRR7Sv/JD8n3EBWdA3a3PirdDSnYuS3hCeLjWlB1et979EqeYRVbUx5Wo4eoJ CGf8NZsGF8paJdNVR4aweCIdNY67oZF9UAJ9qmF0J6goICSVC7hrjrRt72MOeLUCi+4SFrEIA7p OUFcbd4cM3zhEZK9ZFlUHz/k8UsG1+TN4PscPA75+Y3qov2O+n77/scSdToJKEJPgserZpG/aH2 x1uJxqLuctSvPFOd9Syp47WQz/CvLmfWX+P7jK8Oj2ai/+l5Amq1fRejvEEvuV X-Received: by 2002:a17:903:2ad0:b0:2bd:7e8e:ad56 with SMTP id d9443c01a7336-2c6650c0f1amr2373205ad.6.1781441302378; Sun, 14 Jun 2026 05:48:22 -0700 (PDT) Received: from google.com (199.255.142.34.bc.googleusercontent.com. [34.142.255.199]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c86651adc16sm6026664a12.31.2026.06.14.05.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2026 05:48:21 -0700 (PDT) Date: Sun, 14 Jun 2026 12:48:16 +0000 From: Pranjal Shrivastava To: Samiullah Khawaja Cc: Pasha Tatashin , Mike Rapoport , Pratyush Yadav , Alexander Graf , David Matlack , tarunsahu@google.com, open list , "open list:KEXEC HANDOVER (KHO)" , "open list:KEXEC HANDOVER (KHO)" Subject: Re: [PATCH 1/1] liveupdate: luo_file: Add internal APIs for file preservation Message-ID: References: <20260613012521.835490-1-skhawaja@google.com> <20260613012521.835490-2-skhawaja@google.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: <20260613012521.835490-2-skhawaja@google.com> On Sat, Jun 13, 2026 at 01:25:20AM +0000, Samiullah Khawaja wrote: > From: Pasha Tatashin > > Live update orchestrator file handlers depend on the preservation of > other files. To make sure that the dependency is preserved, the file > handlers needs to fetch the preservation token of the preserved > dependency. Similarly during restore, a file handler wants to fetch the > restored file of the dependency. > > Add APIs that allows fetching token of dependency during preservation, > and fetching the restored file dependency during restore. > > Signed-off-by: Pasha Tatashin > Signed-off-by: Samiullah Khawaja > --- > include/linux/liveupdate.h | 21 ++++++++++ > kernel/liveupdate/luo_file.c | 69 ++++++++++++++++++++++++++++++++ > kernel/liveupdate/luo_internal.h | 17 ++++++++ > 3 files changed, 107 insertions(+) > [...] > +EXPORT_SYMBOL_GPL(liveupdate_get_token_outgoing); > + > +/** > + * liveupdate_get_file_incoming - Retrieves a preserved file for in-kernel use. > + * @s: The incoming liveupdate session (restored from the previous kernel). > + * @token: The unique token identifying the file to retrieve. > + * @filep: On success, this will be populated with a pointer to the retrieved > + * 'struct file'. > + * > + * Provides a kernel-internal API for other subsystems to retrieve their > + * preserved files after a live update. This function is a simple wrapper > + * around luo_retrieve_file(), allowing callers to find a file by its token. > + * > + * The caller receives a new reference to the file and must call fput() when it > + * is no longer needed. The file's lifetime is managed by LUO and any userspace > + * file descriptors. > + * > + * Context: It must be called with session mutex acquired of a restored session. > + * Return: 0 on success. Returns -ENOENT if no file with the matching token is > + * found, or any other negative errno on failure. > + */ > +int liveupdate_get_file_incoming(struct liveupdate_session *s, u64 token, > + struct file **filep) > +{ > + return luo_retrieve_file(luo_file_set_from_session_locked(s), > + token, filep); > +} > +EXPORT_SYMBOL_GPL(liveupdate_get_file_incoming); Thanks for modifying the comment (as discussed in [1]). This looks good now, along with the EXPORT_SYMBOL_GPL. Reviewed-by: Pranjal Shrivastava Thanks, Praan [1] https://lore.kernel.org/all/agr6yoyYYq2QFxjL@google.com/