Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pstore/zone: rewrite some comments for better understanding

Rewrite some comments to make it more clear and easier to understand;
fix typos.

Signed-off-by: Eugen Hristev <eugen.hristev@linaro.org>
Link: https://lore.kernel.org/r/20241224154405.295840-1-eugen.hristev@linaro.org
Link: https://lore.kernel.org/r/20250117084228.3218024-1-eugen.hristev@linaro.org
Signed-off-by: Kees Cook <kees@kernel.org>

authored by

Eugen Hristev and committed by
Kees Cook
d679c2e1 8ffd015d

+11 -10
+11 -10
fs/pstore/zone.c
··· 43 43 * 44 44 * @magic: magic num for kmsg dump header 45 45 * @time: kmsg dump trigger time 46 - * @compressed: whether conpressed 46 + * @compressed: whether compressed 47 47 * @counter: kmsg dump counter 48 48 * @reason: the kmsg dump reason (e.g. oops, panic, etc) 49 49 * @data: pointer to log data ··· 214 214 atomic_set(&zone->buffer->datalen, wlen + off); 215 215 } 216 216 217 - /* avoid to damage old records */ 217 + /* avoid damaging old records */ 218 218 if (!is_on_panic() && !atomic_read(&pstore_zone_cxt.recovered)) 219 219 goto dirty; 220 220 ··· 249 249 250 250 return 0; 251 251 dirty: 252 - /* no need to mark dirty if going to try next zone */ 252 + /* no need to mark it dirty if going to try next zone */ 253 253 if (wcnt == -ENOMSG) 254 254 return -ENOMSG; 255 255 atomic_set(&zone->dirty, true); ··· 378 378 struct timespec64 time = { }; 379 379 unsigned long i; 380 380 /* 381 - * Recover may on panic, we can't allocate any memory by kmalloc. 381 + * Recover may happen on panic, we can't allocate any memory by kmalloc. 382 382 * So, we use local array instead. 383 383 */ 384 384 char buffer_header[sizeof(*buf) + sizeof(*hdr)] = {0}; ··· 856 856 857 857 /** 858 858 * psz_zone_write will set datalen as start + cnt. 859 - * It work if actual data length lesser than buffer size. 860 - * If data length greater than buffer size, pmsg will rewrite to 861 - * beginning of zone, which make buffer->datalen wrongly. 859 + * It works if actual data length is lesser than buffer size. 860 + * If data length is greater than buffer size, pmsg will rewrite to 861 + * the beginning of the zone, which makes buffer->datalen wrong. 862 862 * So we should reset datalen as buffer size once actual data length 863 - * greater than buffer size. 863 + * is greater than buffer size. 864 864 */ 865 865 if (is_full_data) { 866 866 atomic_set(&zone->buffer->datalen, zone->buffer_size); ··· 878 878 atomic_set(&cxt->on_panic, 1); 879 879 880 880 /* 881 - * if on panic, do not write except panic records 882 - * Fix case that panic_write prints log which wakes up console backend. 881 + * If on panic, do not write anything except panic records. 882 + * Fix the case when panic_write prints log that wakes up 883 + * console backend. 883 884 */ 884 885 if (is_on_panic() && record->type != PSTORE_TYPE_DMESG) 885 886 return -EBUSY;