mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+27727256237e6bdd3649@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [fuse?] possible deadlock in __folio_end_writeback
Date: Thu,  9 Oct 2025 16:55:14 +0800	[thread overview]
Message-ID: <20251009085515.8396-1-hdanton@sina.com> (raw)
In-Reply-To: <68e583e1.a00a0220.298cc0.0485.GAE@google.com>

> Date: Tue, 07 Oct 2025 14:19:29 -0700	[thread overview]
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    cbf33b8e0b36 Merge tag 'bpf-fixes' of git://git.kernel.org..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=17a25ee2580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=1b4263e12240e6e1
> dashboard link: https://syzkaller.appspot.com/bug?extid=27727256237e6bdd3649
> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14eaea7c580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=134c4304580000

#syz test

--- x/include/linux/flex_proportions.h
+++ y/include/linux/flex_proportions.h
@@ -31,7 +31,7 @@ struct fprop_global {
 	/* Current period */
 	unsigned int period;
 	/* Synchronization with period transitions */
-	seqcount_t sequence;
+	seqlock_t sequence;
 };
 
 int fprop_global_init(struct fprop_global *p, gfp_t gfp);
--- x/lib/flex_proportions.c
+++ y/lib/flex_proportions.c
@@ -44,7 +44,7 @@ int fprop_global_init(struct fprop_globa
 	err = percpu_counter_init(&p->events, 1, gfp);
 	if (err)
 		return err;
-	seqcount_init(&p->sequence);
+	seqlock_init(&p->sequence);
 	return 0;
 }
 
@@ -64,21 +64,20 @@ void fprop_global_destroy(struct fprop_g
 bool fprop_new_period(struct fprop_global *p, int periods)
 {
 	s64 events = percpu_counter_sum(&p->events);
+	unsigned long flags;
 
 	/*
 	 * Don't do anything if there are no events.
 	 */
 	if (events <= 1)
 		return false;
-	preempt_disable_nested();
-	write_seqcount_begin(&p->sequence);
+	write_seqlock_irqsave(&p->sequence, flags);
 	if (periods < 64)
 		events -= events >> periods;
 	/* Use addition to avoid losing events happening between sum and set */
 	percpu_counter_add(&p->events, -events);
 	p->period += periods;
-	write_seqcount_end(&p->sequence);
-	preempt_enable_nested();
+	write_sequnlock_irqrestore(&p->sequence, flags);
 
 	return true;
 }
@@ -148,15 +147,15 @@ void fprop_fraction_percpu(struct fprop_
 			   struct fprop_local_percpu *pl,
 			   unsigned long *numerator, unsigned long *denominator)
 {
-	unsigned int seq;
+	unsigned seq;
 	s64 num, den;
 
 	do {
-		seq = read_seqcount_begin(&p->sequence);
+		seq = read_seqbegin(&p->sequence);
 		fprop_reflect_period_percpu(p, pl);
 		num = percpu_counter_read_positive(&pl->events);
 		den = percpu_counter_read_positive(&p->events);
-	} while (read_seqcount_retry(&p->sequence, seq));
+	} while (read_seqretry(&p->sequence, seq));
 
 	/*
 	 * Make fraction <= 1 and denominator > 0 even in presence of percpu
--

  parent reply	other threads:[~2025-10-09  8:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 21:19 syzbot
2025-10-08  1:10 ` Hillf Danton
2025-10-08  1:32   ` syzbot
2025-10-09  8:55 ` Hillf Danton [this message]
2025-10-09  9:16   ` syzbot
2025-11-30 22:47 ` Tingmao Wang
2026-08-26  9:09 ` Forwarded: " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251009085515.8396-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+27727256237e6bdd3649@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®