nbdkit/0005-vram-Fix-trim-command.patch
Richard W.M. Jones 1bd2da2418 Rebase to nbdkit 1.45.12
resolves: RHEL-111242

Synchronize spec file with Fedora.
2025-11-05 09:29:58 +00:00

32 lines
820 B
Diff

From 258822bde3eb4923b309431c6e4d71932e83932d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 1 Nov 2025 09:33:37 +0000
Subject: [PATCH] vram: Fix trim command
Fix missing updates in the loop, which caused trim operations to spin
forever.
Fixes: commit e35fb68748ecd1ebab63308db3c9a6ccca12ebcb
---
plugins/vram/vram.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plugins/vram/vram.c b/plugins/vram/vram.c
index 64cfe0fa..63e7d5c7 100644
--- a/plugins/vram/vram.c
+++ b/plugins/vram/vram.c
@@ -811,6 +811,10 @@ vram_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
/* Aligned body */
while (count >= BUFFER_SIZE) {
free_buffer (bufnum);
+
+ count -= BUFFER_SIZE;
+ offset += BUFFER_SIZE;
+ bufnum++;
}
return 0;
--
2.47.3