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 8DE2B3C6A43 for ; Fri, 3 Apr 2026 17:26:59 +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=1775237219; cv=none; b=Nu1z8ok4OFyI9WbArKWVFGUEwFl6gdE2sxLzQaYNX202zHXyYMIU2AXEBKjqomBbkbsNn97ctyW3hfBkaviB8U51019Z7wOnSlLrpvZPu8pkkz62rjGafJz+4fEUfQ38THIcKh4JR7kRqhXNg4Xaxfi28wAZx8CoSIqrgAfe5Dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775237219; c=relaxed/simple; bh=wJz25oJqTKdVsVAMNyRk2WMUnyFs9LP5lZm95x8AIQo=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=O/F3w6TcbtS9aUVmd3f7gZNow2WgNS9mqUxBFcaHbL9tX9e3Pmr4R5QB6q3BSNoECsYxxpJ7Tc/Ep1d2cqsCRCNDWTPxHNHW1uf6i9Sb+AypUv5DhLEz0+z5z8/Ooh9O82JVfWJ/qPI9XYFVkES96B06Jny6bqpOUVL5WIFA4Yo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=x5hNqH+f; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="x5hNqH+f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C62DC4CEF7; Fri, 3 Apr 2026 17:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1775237219; bh=wJz25oJqTKdVsVAMNyRk2WMUnyFs9LP5lZm95x8AIQo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=x5hNqH+fWih9tgfB1W8h+XqTYFf4c+6TUXy7wGDmmR/aNU/8XxXGDzaJgCZFreus2 7m6RD+ufedmDWolQjUbiG46zshhZiXQCQRzZ/nmDTOSTas4dkcdrKC9JrhmeKRuVuW x6uFAli5HHDCk3pQSqGVKthzp87SUVs0cmh20WyI= Date: Fri, 3 Apr 2026 10:26:58 -0700 From: Andrew Morton To: Pratyush Yadav Cc: Leo Timmins , pasha.tatashin@soleen.com, rppt@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] liveupdate: initialize incoming FLB state before finish Message-Id: <20260403102658.bc3319bc6db502e7cbfdf860@linux-foundation.org> In-Reply-To: <2vxzv7e8e7om.fsf@kernel.org> References: <20260326042546.8031-1-leotimmins1974@gmail.com> <20260326042546.8031-3-leotimmins1974@gmail.com> <2vxzmrzlfq4e.fsf@kernel.org> <20260402111550.82c0f204ccaae2f81d584d71@linux-foundation.org> <2vxzv7e8e7om.fsf@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 03 Apr 2026 09:04:25 +0000 Pratyush Yadav wrote: > On Thu, Apr 02 2026, Andrew Morton wrote: > > > On Thu, 02 Apr 2026 13:28:33 +0000 Pratyush Yadav wrote: > > > >> The state of an incoming FLB object is initialized when it is first > >> used. The initialization is done via luo_flb_retrieve_one(), which looks > >> at all the incoming FLBs, matches the FLB to its serialized entry, and > >> initializes the incoming data and count. > >> > >> luo_flb_file_finish_one() is called when finish is called for a file > >> registered with this FLB. If no file handler has used the FLB by this > >> point, the count stays un-initialized at 0. luo_flb_file_finish_one() > >> then decrements this un-initialized count, leading to an underflow. This > >> results in the FLB finish never being called since the count has > >> underflowed to a very large value. > >> > >> Fix this by making sure the FLB is retrieved before using its count. > > > > I like that the above tells people what the actual bug is! > > > > I still have both Leo's patches in mm.git, in wait-and-see mode. What > > to do here? Should I upstream [1/2] and drop [2/2]? Drop both and > > revisit after -rc1? > > These are independent fixes, so I would suggest keeping 1/2 regardless > of what we do with 2/2. For 2/2, I would suggest replacing it with the > version I sent in <2vxzmrzlfq4e.fsf@kernel.org>. OK, thanks. I removed [2/2] "liveupdate: initialize incoming FLB state before finish" from mm.git. I added cc:stable to [1/1] "liveupdate: propagate file deserialization failures" and altered its changelog to present it as a singleton patch (no "Patch series..." header, no "This patch (of 2)", etc. Below. > Mike/Pasha/Leo, if you could review my version then that would be great. > > Also Leo, please help with testing. I don't have a setup ready for > testing this corner case. I can set something up mid next week, but it > would be great if you can test this before that. > > > > > Also, did we consider cc:stable for these two? Perhaps add the > > cc:stable if we decide to attend to this after -rc1? > > FLB landed in v7.0-rc1 so no need for cc:stable for patch 2/2. For patch > 1/2, I think cc:stable does make sense, but it only landed in v6.19 so > not super important given it is not LTS. OK. When considering cc:stable I personally don't pay attention to LTS release cadence - I believe others do so. Because it could be that some downstream people are using non-LTS Linus kernels. But then they should be looking at the Fixes: tags. From: Leo Timmins Subject: liveupdate: propagate file deserialization failures Date: Wed, 25 Mar 2026 12:46:07 +0800 luo_session_deserialize() ignored the return value from luo_file_deserialize(). As a result, a session could be left partially restored even though the /dev/liveupdate open path treats deserialization failures as fatal. Propagate the error so a failed file deserialization aborts session deserialization instead of silently continuing. Link: https://lkml.kernel.org/r/20260325044608.8407-1-leotimmins1974@gmail.com Link: https://lkml.kernel.org/r/20260325044608.8407-2-leotimmins1974@gmail.com Fixes: 16cec0d26521 ("liveupdate: luo_session: add ioctls for file preservation") Signed-off-by: Leo Timmins Reviewed-by: Pasha Tatashin Reviewed-by: Pratyush Yadav Cc: Mike Rapoport Cc: Signed-off-by: Andrew Morton --- kernel/liveupdate/luo_session.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/kernel/liveupdate/luo_session.c~liveupdate-propagate-file-deserialization-failures +++ a/kernel/liveupdate/luo_session.c @@ -558,8 +558,13 @@ int luo_session_deserialize(void) } scoped_guard(mutex, &session->mutex) { - luo_file_deserialize(&session->file_set, - &sh->ser[i].file_set_ser); + err = luo_file_deserialize(&session->file_set, + &sh->ser[i].file_set_ser); + } + if (err) { + pr_warn("Failed to deserialize files for session [%s] %pe\n", + session->name, ERR_PTR(err)); + return err; } } _