Hi hackers, The comment above pgstat_slru_flush_cb() in pgstat_slru.c describes the return value twice, and the two descriptions contradict each other:
/*
* Flush out locally pending SLRU stats entries
*
* If nowait is true, this function returns false on lock failure. Otherwise
* this function always returns true.
*
* If nowait is true, this function returns true if the lock could not be
* acquired. Otherwise return false.
*/
The first paragraph has the return value backwards. The function
returns true only when nowait is set and the lock could not be
acquired, and false otherwise, as the second paragraph correctly
states. The reversed paragraph is a leftover from f4d3ca421d9, which
removed an unrelated sentence but not the surrounding text.
The attached patch removes the incorrect first paragraph.
Thoughts?
--
Best regards,
Shinya Kato
NTT OSS Center
v1-0001-pgstat-Fix-return-value-comment-for-pgstat_slru_f.patch
Description: Binary data
