From nobody Thu Apr 2 18:49:26 2026 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 1E6722F0C7E for ; Fri, 27 Mar 2026 03:33:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774582429; cv=none; b=Xbu65buC1DDVgZfA3FFfL4grtCH26ZozbUq/Pv/2zMoE+58YO8vaSkpkf4CkVgE5KYZM/OajGCzvHrM+/pOhdfIUdK8BERJH5qifPMAjPC4a01VbKn6J0s8WDjUNziRTt04VmWLs3Hk3V7Ie+Kh0Qh2jc3LStAm/0h3hppH86ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774582429; c=relaxed/simple; bh=KiVRPvd/rzk48at/tBiksGzO/I9lEBzYmy5ywXyMb+k=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U3Lt7aFV7KmBZ/LNPHuTMbYuWzwn5bbz6fxWfD7Jtt9HUD1evqfDNe5/HUxvntKV4r/h9PiuM6P97aLtjg2RgkWgS+wAQpyurhMfI/Y2+v5fnff9PezZLOi0MDvJUyt4m1ysQQ63dejSh7HNt/I1mYyAKr7iY8YdCte6h6yoyPw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=Ej0vPuKv; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="Ej0vPuKv" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-89c5446f3caso20519046d6.2 for ; Thu, 26 Mar 2026 20:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1774582427; x=1775187227; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=niK9b97p+Uodq6B81NUl3qD7iaGbf0m6LGlP3YYxUso=; b=Ej0vPuKvMp30aTlGRFqbRKIOLcN5Z45A7as5KR/nejhIV4d+/3x6OEY2PygNZHpI8E bt6g3BDSv/1u7MDZtsIl34YWlaKE9nBVl9v1Mf4tLbfRaZzULqK7pKnrpjW5cvdW0JaA RLr4okz2oeJM9bmVCHV9VFeX0recsM0EPKYAaoikDMOsPaQVTD8SyzeIz5nirhGtMUhq IhJ9RhflGj8Dg571E4xVoWo2PqWAisEePuHc43GxZNzKslhFpaESqbUnJzJ9bIFJyA2B Vd6hNyTT2+lqHBnqpc68yVdUlZtoW8JtybjO7EyUzlCrur7b5o9LNseOvBwxol03mZun 8l6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774582427; x=1775187227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=niK9b97p+Uodq6B81NUl3qD7iaGbf0m6LGlP3YYxUso=; b=JDKPhQ9pzcVFF4kDPdVtufDkueNO7CKD9D80k4K+VeF3lVQnkDjph77FJ8Z7IY//JX SZbKeZZX09JEghNA58nRLD1PQkm7D2YY+OMzc1FKD/eGeNh10/eimeFyr90+kqlYM3Vq SL8IYqJ8T7vRiXTWtkt1NEES2P10sQ9UCls8SOUDwaGynVuQe8juB7DKvgTDnHUfcu5G rHGtng3/7MIccRgcnqcWrrk+IZ4vN4zVsnVlEJ6qavpeNDDjEPykNjjQTiVawRL2UtDb WJ3c/fvBiPMfnryU+uJZJ9o8E25rlu8vOx8yvzumXWWrtnV4bX5492ZzHMSKpa8FS7i0 v/Uw== X-Forwarded-Encrypted: i=1; AJvYcCWTt0/Xosn4sR35A2DkAgHHCyq7Gu6/19HN/or4mjjqItIioRq7tzG7Uh56/UDcIOBcqPQVGXJ9Xkcg3YM=@vger.kernel.org X-Gm-Message-State: AOJu0YzC71OpTyMapRzWRDQBpkPONyWBvMS0y+1q+wSSMQSyLnDbsGga nPnbG655Rh0FhykbhElGl0TkFbEfYAKZPvawR/JOEoEL0lHomeNC9OFrQRN1Kn3bmy3RgezVTcI sUUgL X-Gm-Gg: ATEYQzxdUKzYJFKAKCynopHrTuvoSpbuGnnCdDIq3WAbMZBp2IU99lVrpdqsKqsFCD3 GLaatXz8M6oM/xhXz6STC4swGf+SxKMUejA76yhug3P7XHKaBZKSWqCNeNfTUaVn50Yl0WKjGl0 BgobzKX/gAfuNSrqL+OmNnkG/YiuMYRSUWZSKlaocSAi/w9vsOEsXqN+mfoWXKQFEkgwiuPs5jE p0tA0ZRM5ao5kikGnj+w1iXWA36Lt6KTMm0vW+xqSETfteM6/6UsHV831307d0fQS0DVnfEC5cw 6zbXNPtOhCtw67IUIvoiK02vtoRMbVNbW2Og7ZsovBwvXmM8QQhh2jP3zCDbJosfbT3YdWeRb6L ikx8NsJqlbkdglE767T2dJ8DOvT3rMvrpkeDinS0kePwRB0cBB3lbjstAYr3dfAZ8NVezo6dNDe Z2DmBGD6CmkHdAblagD5oEL0Jbgcr6fIVUM7YzQJ0+0gAw3hzWtSF1E4POLkf7BzhWRQ== X-Received: by 2002:a05:6214:2b0b:b0:89c:d592:3a97 with SMTP id 6a1803df08f44-89ce8ee0c69mr11196086d6.30.1774582426820; Thu, 26 Mar 2026 20:33:46 -0700 (PDT) Received: from plex.localdomain ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89cd5a22711sm46519186d6.27.2026.03.26.20.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 20:33:46 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, dmatlack@google.com, pratyush@kernel.org, skhawaja@google.com Subject: [PATCH v3 09/10] liveupdate: Make unregister functions return void Date: Fri, 27 Mar 2026 03:33:33 +0000 Message-ID: <20260327033335.696621-10-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260327033335.696621-1-pasha.tatashin@soleen.com> References: <20260327033335.696621-1-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Change liveupdate_unregister_file_handler and liveupdate_unregister_flb to return void instead of an error code. This follows the design principle that unregistration during module unload should not fail, as the unload cannot be stopped at that point. Signed-off-by: Pasha Tatashin --- include/linux/liveupdate.h | 14 ++++++-------- kernel/liveupdate/luo_file.c | 14 ++------------ kernel/liveupdate/luo_flb.c | 11 +++-------- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h index 73ca84de3eae..2ae27711ac41 100644 --- a/include/linux/liveupdate.h +++ b/include/linux/liveupdate.h @@ -229,12 +229,12 @@ bool liveupdate_enabled(void); int liveupdate_reboot(void); =20 int liveupdate_register_file_handler(struct liveupdate_file_handler *fh); -int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh); +void liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh= ); =20 int liveupdate_register_flb(struct liveupdate_file_handler *fh, struct liveupdate_flb *flb); -int liveupdate_unregister_flb(struct liveupdate_file_handler *fh, - struct liveupdate_flb *flb); +void liveupdate_unregister_flb(struct liveupdate_file_handler *fh, + struct liveupdate_flb *flb); =20 int liveupdate_flb_get_incoming(struct liveupdate_flb *flb, void **objp); int liveupdate_flb_get_outgoing(struct liveupdate_flb *flb, void **objp); @@ -256,9 +256,8 @@ static inline int liveupdate_register_file_handler(stru= ct liveupdate_file_handle return -EOPNOTSUPP; } =20 -static inline int liveupdate_unregister_file_handler(struct liveupdate_fil= e_handler *fh) +static inline void liveupdate_unregister_file_handler(struct liveupdate_fi= le_handler *fh) { - return -EOPNOTSUPP; } =20 static inline int liveupdate_register_flb(struct liveupdate_file_handler *= fh, @@ -267,10 +266,9 @@ static inline int liveupdate_register_flb(struct liveu= pdate_file_handler *fh, return -EOPNOTSUPP; } =20 -static inline int liveupdate_unregister_flb(struct liveupdate_file_handler= *fh, - struct liveupdate_flb *flb) +static inline void liveupdate_unregister_flb(struct liveupdate_file_handle= r *fh, + struct liveupdate_flb *flb) { - return -EOPNOTSUPP; } =20 static inline int liveupdate_flb_get_incoming(struct liveupdate_flb *flb, diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index dd55e5e74d69..761e8f7cfc82 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -884,25 +884,15 @@ int liveupdate_register_file_handler(struct liveupdat= e_file_handler *fh) * * Unregisters the file handler from the liveupdate core. This function * reverses the operations of liveupdate_register_file_handler(). - * - * It ensures safe removal by checking that: - * No FLB registered with this file handler. - * - * If the unregistration fails, the internal test state is reverted. - * - * Return: 0 Success. -EOPNOTSUPP when live update is not enabled. -EBUSY = A live - * update is in progress, FLB is registred with this file handler. */ -int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) +void liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) { if (!liveupdate_enabled()) - return -EOPNOTSUPP; + return; =20 guard(rwsem_write)(&luo_register_rwlock); luo_flb_unregister_all(fh); list_del(&ACCESS_PRIVATE(fh, list)); =20 module_put(fh->ops->owner); - - return 0; } diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c index f8348138de70..8f3c9c63e320 100644 --- a/kernel/liveupdate/luo_flb.c +++ b/kernel/liveupdate/luo_flb.c @@ -492,21 +492,16 @@ int liveupdate_register_flb(struct liveupdate_file_ha= ndler *fh, * owner module (acquired during registration) is released. * * Context: It is typically called from a subsystem's module exit function. - * Return: 0 on success. - * -EOPNOTSUPP if live update is disabled. - * -ENOENT if the FLB was not found in the file handler's list. */ -int liveupdate_unregister_flb(struct liveupdate_file_handler *fh, - struct liveupdate_flb *flb) +void liveupdate_unregister_flb(struct liveupdate_file_handler *fh, + struct liveupdate_flb *flb) { if (!liveupdate_enabled()) - return -EOPNOTSUPP; + return; =20 guard(rwsem_write)(&luo_register_rwlock); =20 luo_flb_unregister_one(fh, flb); - - return 0; } =20 /** --=20 2.43.0