Re: [PATCH] pm-hibernate: flush block device cache when hibernating

Christoph Hellwig <[email protected]> Wed, 29 Oct 2025 07:38:13 -0700
Newsgroups gmane.linux.lvm.devel
Message-ID <aQIm1bfwKlwaak52__21237.1285002277$1761751900$gmane$org@infradead.org>
On Wed, Oct 29, 2025 at 02:31:05PM +0100, Rafael J. Wysocki wrote:
> > This commit fixes the suspend code so that it issues flushes before
> > writing the header and after writing the header.
> 
> Hmm, shouldn't it flush every time it does a sync write, and not just
> in these two cases?

It certainly should not use the PREFLUSH flag that flushes before
writing, as the cache will be dirty again after that.

I'd expect a single blkdev_issue_flush after all writing is done,
under the assumption that the swsusp swap writing doesn't have
transaction integrity for individual writes anyway.