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 BFA0E23EAAD for ; Sun, 25 Jan 2026 11:52:08 +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=1769341928; cv=none; b=cejUoRBryTiFBPal44kNMEQZXAV2g7iiPRs36apxxwpWsV8a5TsAKp5CjvVzMF4NyilD6NTWllghwWvtMs4BTB8djKdiHoJfAGXARGyo2HlvwjWC4IGj+984z8jq1h0ts4PFgaVK61ZkLL3Rua911WL5h3iYjMd6mDFYN0eOBkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769341928; c=relaxed/simple; bh=iF5UwdbLx3lobfdhIsiNN5Ktf/ekLJHA9XetyqKlp6w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lyUWq2uJ6ICjyVq6xNpTd+y+LARFc4BYmCTJUU3zAJ38zvKryrHlio2sfB48EbaMKHEfRvu2fg9WwjO98w/X2AQJRbUMJj2oz91+YfquW5GMVMYzzQnlCWk9jM2WIKf+hGB5fluXPvnzvhtQjuMtCE47EWW0ngQTJ2VVSv6QiKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RlinmGtC; 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="RlinmGtC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6121C4CEF1; Sun, 25 Jan 2026 11:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769341928; bh=iF5UwdbLx3lobfdhIsiNN5Ktf/ekLJHA9XetyqKlp6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RlinmGtCV5do+fZPL7nAszMQ8paDm3KutZYyue7aB8Ty5G9Kq3P0jh/Bo931S0z6M pAzQQWRdVzR1dpH1Fx377PGCxDPleGB6dYACGOs7o2M2z5TjZrKHyaFR/pRSptAs2x 0BCrsz25RPCRvQoZZDnwfBkXN4jvuyuZN7dJEwddNn8a46eQX6TurhH47R9yLqDCR/ 4qQ/ipykXjpLdk2+SvVorfeYfo0gxv/1YwFKgpnXx435jBPuSH4gxrzXj2MgJNkHUH xtXJs9LQDzsV7iSlqNsqs3gbVIwdSqh/Sqv9Qc1/2bTAgg9FXhrI1NLqAENq1OAgR/ p6+5MS3tT1E/A== Date: Sun, 25 Jan 2026 13:52:01 +0200 From: Mike Rapoport To: Pratyush Yadav Cc: Alexander Graf , Pasha Tatashin , Hugh Dickins , Baolin Wang , Andrew Morton , Jason Gunthorpe , Samiullah Khawaja , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] memfd: export memfd_{add,get}_seals() Message-ID: References: <20260123095854.535058-1-pratyush@kernel.org> <20260123095854.535058-2-pratyush@kernel.org> 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: <20260123095854.535058-2-pratyush@kernel.org> On Fri, Jan 23, 2026 at 10:58:50AM +0100, Pratyush Yadav wrote: > From: "Pratyush Yadav (Google)" > > Support for preserving file seals will be added to memfd preservation > using the Live Update Orchestrator (LUO). Export > memfd_{add,get}_seals)() so memfd_luo can use them to manipulate the > seals. > > Signed-off-by: Pratyush Yadav (Google) Acked-by: Mike Rapoport (Microsoft) > --- > include/linux/memfd.h | 12 ++++++++++++ > mm/memfd.c | 4 ++-- > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/include/linux/memfd.h b/include/linux/memfd.h > index c328a7b356d0..b4fda09dab9f 100644 > --- a/include/linux/memfd.h > +++ b/include/linux/memfd.h > @@ -18,6 +18,8 @@ struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx); > */ > int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr); > struct file *memfd_alloc_file(const char *name, unsigned int flags); > +int memfd_get_seals(struct file *file); > +int memfd_add_seals(struct file *file, unsigned int seals); > #else > static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a) > { > @@ -37,6 +39,16 @@ static inline struct file *memfd_alloc_file(const char *name, unsigned int flags > { > return ERR_PTR(-EINVAL); > } > + > +static inline int memfd_get_seals(struct file *file) > +{ > + return -EINVAL; > +} > + > +static inline int memfd_add_seals(struct file *file, unsigned int seals) > +{ > + return -EINVAL; > +} > #endif > > #endif /* __LINUX_MEMFD_H */ > diff --git a/mm/memfd.c b/mm/memfd.c > index f032c6052926..46c5508beea4 100644 > --- a/mm/memfd.c > +++ b/mm/memfd.c > @@ -228,7 +228,7 @@ static unsigned int *memfd_file_seals_ptr(struct file *file) > F_SEAL_WRITE | \ > F_SEAL_FUTURE_WRITE) > > -static int memfd_add_seals(struct file *file, unsigned int seals) > +int memfd_add_seals(struct file *file, unsigned int seals) > { > struct inode *inode = file_inode(file); > unsigned int *file_seals; > @@ -310,7 +310,7 @@ static int memfd_add_seals(struct file *file, unsigned int seals) > return error; > } > > -static int memfd_get_seals(struct file *file) > +int memfd_get_seals(struct file *file) > { > unsigned int *seals = memfd_file_seals_ptr(file); > > -- > 2.52.0.457.g6b5491de43-goog > -- Sincerely yours, Mike.