⬢ DragonFlyBSD Kernel Audit
DF-3118 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/hammer/hammer.h	2026-09-06 15:20:21.545193609 +0000
+++ b/sys/vfs/hammer/hammer.h	2026-09-06 15:21:17.480480754 +0000
@@ -289,7 +289,7 @@
 typedef struct hammer_flush_group {
 	TAILQ_ENTRY(hammer_flush_group)	flush_entry;
 	struct hammer_fls_rb_tree	flush_tree;
-	int				seq;		/* our seq no */
+	unsigned int		seq;		/* our seq no (ring) */
 	int				total_count;	/* record load */
 	int				running;	/* group is running */
 	int				closed;
@@ -737,7 +737,7 @@
 typedef struct hammer_reserve {
 	RB_ENTRY(hammer_reserve) rb_node;
 	TAILQ_ENTRY(hammer_reserve) delay_entry;
-	int		flg_no;
+	unsigned int		flg_no;		/* flusher seq (ring) */
 	int		flags;
 	int		refs;
 	int		zone;
@@ -771,8 +771,8 @@
 
 struct hammer_flusher {
 	int		signal;		/* flusher thread sequencer */
-	int		done;		/* last completed flush group */
-	int		next;		/* next unallocated flg seqno */
+	unsigned int	done;		/* last completed flush group (ring) */
+	unsigned int	next;		/* next unallocated flg seqno (ring) */
 	int		group_lock;	/* lock sequencing of the next flush */
 	int		exiting;	/* request master exit */
 	thread_t	td;		/* master flusher thread */
--- a/sys/vfs/hammer/hammer_flusher.c	2026-09-06 15:20:21.545193609 +0000
+++ b/sys/vfs/hammer/hammer_flusher.c	2026-09-06 15:21:17.480480754 +0000
@@ -71,7 +71,7 @@
 void
 hammer_flusher_sync(hammer_mount_t hmp)
 {
-	int seq;
+	unsigned int seq;
 
 	seq = hammer_flusher_async(hmp, NULL);
 	hammer_flusher_wait(hmp, seq);
@@ -91,7 +91,7 @@
 hammer_flusher_async(hammer_mount_t hmp, hammer_flush_group_t close_flg)
 {
 	hammer_flush_group_t flg;
-	int seq;
+	unsigned int seq;
 
 	/*
 	 * Already closed
@@ -144,7 +144,7 @@
 hammer_flusher_async_one(hammer_mount_t hmp)
 {
 	hammer_flush_group_t flg;
-	int seq;
+	unsigned int seq;
 
 	if (hmp->flusher.td) {
 		flg = TAILQ_FIRST(&hmp->flush_group_list);
@@ -175,7 +175,7 @@
 int
 hammer_flusher_running(hammer_mount_t hmp)
 {
-	int seq = hmp->flusher.next - 1;
+	unsigned int seq = hmp->flusher.next - 1;
 	if (seq - hmp->flusher.done > 0)
 		return(1);
 	return (0);
@@ -251,7 +251,7 @@
 hammer_flusher_master_thread(void *arg)
 {
 	hammer_mount_t hmp;
-	int seq;
+	unsigned int seq;
 	int nomore;
 
 	hmp = arg;
@@ -311,7 +311,7 @@
 	hammer_flush_group_t flg;
 	hammer_reserve_t resv;
 	int count;
-	int seq;
+	unsigned int seq;
 
 	/*
 	 * Just in-case there's a flush race on mount.  Seq number