]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs/proc/vmcore: convert vmcore_cb_lock into vmcore_mutex
authorDavid Hildenbrand <david@redhat.com>
Wed, 4 Dec 2024 12:54:32 +0000 (13:54 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Jan 2025 14:38:34 +0000 (09:38 -0500)
commitcdbc69716ff3a126cef43154742858e1caffa858
tree50387de2f8fb95ba529a25dbb6a42c3b8338133e
parent33bb2d16063bd105acd99075a6161761ab510e33
fs/proc/vmcore: convert vmcore_cb_lock into vmcore_mutex

We want to protect vmcore modifications from concurrent opening of
the vmcore, and also serialize vmcore modification.

(a) We can currently modify the vmcore after it was opened. This can happen
    if a vmcoredd is added after the vmcore module was initialized and
    already opened by user space. We want to fix that and prepare for
    new code wanting to serialize against concurrent opening.

(b) To handle it cleanly we need to protect the modifications against
    concurrent opening. As the modifications end up allocating memory and
    can sleep, we cannot rely on the spinlock.

Let's convert the spinlock into a mutex to prepare for further changes.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20241204125444.1734652-2-david@redhat.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
fs/proc/vmcore.c