[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIeMQfVNucc3_RRa@casper.infradead.org>
Date: Mon, 28 Jul 2025 15:42:09 +0100
From: Matthew Wilcox <willy@...radead.org>
To: laishangzhen <laishangzhen@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: Removing the card during write
On Mon, Jul 28, 2025 at 07:13:06AM -0700, laishangzhen wrote:
> When formatting an SD card to ext4 using mkfs.ext4,
> if the card is ejected during the process,
> the formatting process blocks at
> balance_dirty_pages_ratelimited.
You're fixing this in the wrong place; it should be in mm/page-writeback.c
somewhere.
But it really needs a more thorough analysis than this. To date we do
not handle removable media well. I wrote up a proposal in 2018 here:
http://www.wil.cx/~willy/banbury.html but I haven't done any work
towards it.
You're proposing an entirely different approach which is to just,
well, kill applications. This leaves pages in the page cache which are
effectively leaked. If we continue on this path, we'd also want a way to
release all the pages in the page cache associated with this block device.
And that's a harder problem than you might think.
Powered by blists - more mailing lists