From nobody Sun Feb 8 12:13:49 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 0531C1F8ACC for ; Fri, 17 Jan 2025 08:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737103364; cv=none; b=F7/trHbMJn3r6DHsfEtNTvPner6Ytq8gFsMZ4vbLIJkeXJeVrgpYN8XjLqL6WkqmWhE//tXO4T4KbeHGPvhAW9os4ZmZe59KduSnNLcr06vjhOU+PhbkH0eH5sDuR0UtkffHtDJrMoedBJv4B4VyM19Biux8RDbnJHjHW5n7LlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737103364; c=relaxed/simple; bh=C0pXPebYk/Z6eKCj51xDuC/4vVpAywT2Dl8KQgqFL5o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BGMrBlr8ZFFbL8dKtvXv3nKa79Yv4zZ63a/VzuMaT+7ZsWL5TmcOX478ZlUu5noI8PauDz3fdsMQFZCkY30MTlRs/rLaaabqEDjTcRdeb7NE/oKnCTm69NO5ebuvkpgWVyqyUa531BACLjZuBHrYKDDE+UlFSmLpmhrsn+PdaT8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SPOQhju5; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SPOQhju5" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-385df53e559so1388585f8f.3 for ; Fri, 17 Jan 2025 00:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737103361; x=1737708161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nCOF/7DWf6/+p38Tf4t2GS4pCPMHx5hroCn7XUZPVyc=; b=SPOQhju5nDUu6OQf62tWeUTlGM3NdSVT6alHlibQpwTiGhEZi7DtmbQOWPuTDzvtl7 mmvWG78J1Nee4lGffNYJETYiNj49sFtNf7/phQRxChho4b4YJtiSHxNXQPuODbO5ZdFL +TrKFPGsVPiIYRfhN1pC4UZnSsIZVsSS0WFhMp0Lbu460zdnOy+9ENocDq3OVHBpSTup myc1KjglBcTOzbMKPECnkB5lCwpq5c5Fedtf52L//qi8uOrPoxp9a3ZAv0d/3wpul1Fj qTYXeoAIlGtw5NAoufdIYmcuHvtcZGC8Bor/6FEYcYjeSBgjgfqULRDWqVNdRXrJhm4F FB1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737103361; x=1737708161; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nCOF/7DWf6/+p38Tf4t2GS4pCPMHx5hroCn7XUZPVyc=; b=Io/xcORmht1gquR9IkvMhKX/7tzNDutNbPtnTCAMb5z9UB6Pl+eakpxpsScukXCDci KGJM0wxarTMQhgMxJoF77tMCDCvtIfEzqI82zAaq0XhZjqe4eRwvG6LRksZ+OLZUrz6z sQ0/OzcBFzQDi4+nGHLfHP8JUrlUWONqAS6vkAZfaqlbnvjfcUby4Y23GYk+DNvBogLN z5x/XwXUcVC4IJ/sRiyqLU6kDkW5GKQxY5mcvX1KZ8T3K5gYxujvB+JkzMJF+CK99MAH jjBmFzkBh9G5JLQ97Ey1+kyUj0g1hvPl6LEScQesBrU5DLf9uw2SSv3zkQ3TczPVU3Xs Fotg== X-Forwarded-Encrypted: i=1; AJvYcCWcGBTgu3o6KqktJnhnwdvN5OvHvX7RIFB+VwPS/+5It04yP13S3REAnHBcSN59/DryYmDric8/Mv9U3pM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw19qHqZ7OfkVuWI83KrpAAKYfYzxhDj+tpc2zKmcqrIxO6K942 G/LXzoFI6UoffXKAg3xqFeLBqHqH4Ufl7kcxEftkn4KbAtZkOAjSdQRf0GHQttk= X-Gm-Gg: ASbGnct2y9YwaFXvcd7fLREPT42gZa2yOBvrcTbK5Y1/Qc+WYD8YLvh6S691XQIKPP7 3MjE3ZvJARnBzpqoo4/PJZGBWO8xjEUeanMVm+i/zV8V/5+KzAO5WUBqutvbEB71xlAv24mnuo7 t1rfkuc6FflnXd+5jqYwmXB0jaZCq+XApctZ3ZLE7yNBOO8B0V3Q9C6UGh+JI3SJzQ+yrt6HwXv a8b3Cak7Yc7XuF9eBPgjf692JSFL5xSyrqEHYPuz5fPgIKllyJlZHwMRHUavXeUrTNki3DhMQ== X-Google-Smtp-Source: AGHT+IE0g2r4mNuufMYa1SF7rV4BL9Qgy7k7aHEbEjsbW6jZHbIv/diqdIIXdLchTvnzZ3HNocPLRQ== X-Received: by 2002:a05:6000:156c:b0:385:dedb:a156 with SMTP id ffacd0b85a97d-38bf5655e66mr1298777f8f.6.1737103361295; Fri, 17 Jan 2025 00:42:41 -0800 (PST) Received: from localhost.localdomain ([2a00:f29:229:ba3:d022:662:690:4bb8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74c6179sm85902655e9.22.2025.01.17.00.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 00:42:40 -0800 (PST) From: Eugen Hristev To: kees@kernel.org Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Eugen Hristev Subject: [PATCH] pstore/zone: rewrite some comments for better understanding Date: Fri, 17 Jan 2025 10:42:28 +0200 Message-ID: <20250117084228.3218024-1-eugen.hristev@linaro.org> X-Mailer: git-send-email 2.43.0 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" Rewrite some comments to make it more clear and easier to understand. Signed-off-by: Eugen Hristev --- fs/pstore/zone.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index ceb5639a0629..5fa2fa2e7aa7 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -214,7 +214,7 @@ static int psz_zone_write(struct pstore_zone *zone, atomic_set(&zone->buffer->datalen, wlen + off); } =20 - /* avoid to damage old records */ + /* avoid damaging old records */ if (!is_on_panic() && !atomic_read(&pstore_zone_cxt.recovered)) goto dirty; =20 @@ -249,7 +249,7 @@ static int psz_zone_write(struct pstore_zone *zone, =20 return 0; dirty: - /* no need to mark dirty if going to try next zone */ + /* no need to mark it dirty if going to try next zone */ if (wcnt =3D=3D -ENOMSG) return -ENOMSG; atomic_set(&zone->dirty, true); @@ -378,7 +378,7 @@ static int psz_kmsg_recover_meta(struct psz_context *cx= t) struct timespec64 time =3D { }; unsigned long i; /* - * Recover may on panic, we can't allocate any memory by kmalloc. + * Recover may happen on panic, we can't allocate any memory by kmalloc. * So, we use local array instead. */ char buffer_header[sizeof(*buf) + sizeof(*hdr)] =3D {0}; @@ -856,11 +856,11 @@ static int notrace psz_record_write(struct pstore_zon= e *zone, =20 /** * psz_zone_write will set datalen as start + cnt. - * It work if actual data length lesser than buffer size. - * If data length greater than buffer size, pmsg will rewrite to - * beginning of zone, which make buffer->datalen wrongly. + * It works if actual data length is lesser than buffer size. + * If data length is greater than buffer size, pmsg will rewrite to + * the beginning of the zone, which makes buffer->datalen wrong. * So we should reset datalen as buffer size once actual data length - * greater than buffer size. + * is greater than buffer size. */ if (is_full_data) { atomic_set(&zone->buffer->datalen, zone->buffer_size); @@ -878,8 +878,9 @@ static int notrace psz_pstore_write(struct pstore_recor= d *record) atomic_set(&cxt->on_panic, 1); =20 /* - * if on panic, do not write except panic records - * Fix case that panic_write prints log which wakes up console backend. + * If on panic, do not write anything except panic records. + * Fix the case when panic_write prints log that wakes up + * console backend. */ if (is_on_panic() && record->type !=3D PSTORE_TYPE_DMESG) return -EBUSY; --=20 2.43.0