From nobody Tue Sep 29 00:34:17 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 0EA2A35C6AC for ; Fri, 14 Aug 2026 09:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786701347; cv=none; b=eQcN6c98TzPb+mv8hE1+Ygn5E/V5LDi4pIJx6Eaa8fwvG3IIjyN08XxWrmHtkIS84kN3pppBi3D81xTz2XpnXTu6yYJd3IdHD/Y9vsF6Bd7grPU+IyBUufuTgzN+elRe0YR16vlvUbGbfI6wBeKHii8KFbgeC/w3o2/2THH16i0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786701347; c=relaxed/simple; bh=icza9VY0nsLN7ga4o998t2VWfIusnF7NG+9tp6J5bqA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=EB7+kFDifsI6CLbPWpYfUQ3hOs2hIc9QxcodZG8NxToCOo4bYyXSrv/cktmmOwY7GEQDvbhoZbblGmc1TRjsU16ZAb96s3igzrXKg3rIV1h8asoO3PuyMqXm8gV+KUjanuzV6DtqDTF/ag0eUEIiAPrCRCQvPbnQbAyegC+oMqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 4884d2e697c611f1aa26b74ffac11d73-20260814 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NO_NAME, HR_CTE_8B, HR_CTT_MISS HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME, HR_SJ_LANG HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE, HR_SJ_PHRASE_LEN HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME, IP_TRUSTED SRC_TRUSTED, DN_TRUSTED, SA_TRUSTED, SA_EXISTED, SN_EXISTED SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS, CIE_GOOD, CIE_GOOD_SPF GTI_FG_BS, GTI_RG_INFO, GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:12f84e7f-cfa6-4117-9574-2b4cf115c43a,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:10 X-CID-INFO: VERSION:1.3.12,REQID:12f84e7f-cfa6-4117-9574-2b4cf115c43a,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:10 X-CID-META: VersionHash:e7bac3a,CLOUDID:2dcb92359b08659083f82a1655c4f44c,BulkI D:2608141755332MBDLNDU,BulkQuantity:0,Recheck:0,SF:10|38|66|78|102|127|136 |850|865|898,TC:nil,Content:0|15|50,EDM:-3|-100,IP:-2,URL:0,File:nil,RT:ni l,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0, BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 4884d2e697c611f1aa26b74ffac11d73-20260814 X-User: duanchenghao@kylinos.cn Received: from localhost.localdomain [(223.70.159.239)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 456462654; Fri, 14 Aug 2026 17:55:30 +0800 From: Chenghao Duan To: pasha.tatashin@soleen.com, rppt@kernel.org, pratyush@kernel.org, graf@amazon.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org Cc: jianghaoran@kylinos.cn, duanchenghao@kylinos.cn Subject: [PATCH] liveupdate: use scoped_guard for mutex in session operations Date: Fri, 14 Aug 2026 17:55:06 +0800 Message-Id: <20260814095506.631274-1-duanchenghao@kylinos.cn> X-Mailer: git-send-email 2.25.1 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" Replace manually paired mutex_lock/unlock with scoped_guard to align with the coding style of the rest of the codebase and simplify locking paths. Signed-off-by: Chenghao Duan --- kernel/liveupdate/luo_session.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_sessio= n.c index f38b5b18f3f8..06307868a44e 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -290,9 +290,8 @@ static int luo_session_retrieve_fd(struct luo_session *= session, if (argp->fd < 0) return argp->fd; =20 - mutex_lock(&session->mutex); - err =3D luo_retrieve_file(&session->file_set, argp->token, &file); - mutex_unlock(&session->mutex); + scoped_guard(mutex, &session->mutex) + err =3D luo_retrieve_file(&session->file_set, argp->token, &file); if (err < 0) goto err_put_fd; =20 @@ -478,9 +477,8 @@ int luo_session_create(const char *name, struct file **= filep) if (err) goto err_free; =20 - mutex_lock(&session->mutex); - err =3D luo_session_getfile(session, filep); - mutex_unlock(&session->mutex); + scoped_guard(mutex, &session->mutex) + err =3D luo_session_getfile(session, filep); if (err) goto err_remove; up_read(&luo_session_serialize_rwsem); --=20 2.25.1