public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Pratyush Yadav <pratyush@kernel.org>
Cc: Leo Timmins <leotimmins1974@gmail.com>,
	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
Date: Fri, 3 Apr 2026 10:26:58 -0700	[thread overview]
Message-ID: <20260403102658.bc3319bc6db502e7cbfdf860@linux-foundation.org> (raw)
In-Reply-To: <2vxzv7e8e7om.fsf@kernel.org>

On Fri, 03 Apr 2026 09:04:25 +0000 Pratyush Yadav <pratyush@kernel.org> wrote:

> On Thu, Apr 02 2026, Andrew Morton wrote:
> 
> > On Thu, 02 Apr 2026 13:28:33 +0000 Pratyush Yadav <pratyush@kernel.org> 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 <leotimmins1974@gmail.com>
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 <leotimmins1974@gmail.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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;
 		}
 	}
 
_


  reply	other threads:[~2026-04-03 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26  4:25 [PATCH v3 0/2] liveupdate: fix incoming error handling and teardown paths Leo Timmins
2026-03-26  4:25 ` [PATCH v3 1/2] liveupdate: propagate file deserialization failures Leo Timmins
2026-04-02 12:17   ` Pratyush Yadav
2026-03-26  4:25 ` [PATCH v3 2/2] liveupdate: initialize incoming FLB state before finish Leo Timmins
2026-03-26 14:50   ` Pasha Tatashin
2026-04-02 13:28   ` Pratyush Yadav
2026-04-02 18:15     ` Andrew Morton
2026-04-03  9:04       ` Pratyush Yadav
2026-04-03 17:26         ` Andrew Morton [this message]
     [not found]           ` <CA+uuG7Lnc94vTmZPEhbvQXgAzWJDL28Zf=QR=uAkmiWvoW+Uxw@mail.gmail.com>
2026-04-04 15:43             ` Leo Timmins
2026-04-05  7:35               ` Pratyush Yadav
2026-03-28  0:32 ` [PATCH v3 0/2] liveupdate: fix incoming error handling and teardown paths Andrew Morton
2026-03-28  1:47   ` Pasha Tatashin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403102658.bc3319bc6db502e7cbfdf860@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=leotimmins1974@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox