Don't add/use PF_FLUSHER per task flag. Instead add/use per reiser4_context flag flush_bd_task to indicate that it is bd flushing task.
diff -urN linux-5.8.10-reiser4/fs/fs-writeback.c linux-5.8.10/fs/fs-writeback.c --- linux-5.8.10-reiser4/fs/fs-writeback.c 2020-10-11 21:00:01.000000000 +0200 +++ linux-5.8.10/fs/fs-writeback.c 2020-12-12 15:33:16.000000000 +0100 @@ -2090,7 +2090,7 @@ long pages_written; set_worker_desc("flush-%s", bdi_dev_name(wb->bdi)); - current->flags |= PF_FLUSHER | PF_SWAPWRITE; + current->flags |= PF_SWAPWRITE; if (likely(!current_is_workqueue_rescuer() || !test_bit(WB_registered, &wb->state))) { diff -urN linux-5.8.10-reiser4/fs/reiser4/context.c linux-5.8.10/fs/reiser4/context.c --- linux-5.8.10-reiser4/fs/reiser4/context.c 2020-10-11 20:55:06.000000000 +0200 +++ linux-5.8.10/fs/reiser4/context.c 2020-12-12 15:56:05.000000000 +0100 @@ -153,7 +153,7 @@ if (sbinfo != NULL && sbinfo->fake != NULL && context->nr_marked_dirty != 0 && !(current->flags & PF_MEMALLOC) && - !current_is_flush_bd_task()) + !context->flush_bd_task) reiser4_throttle_write(sbinfo->fake); } diff -urN linux-5.8.10-reiser4/fs/reiser4/context.h linux-5.8.10/fs/reiser4/context.h --- linux-5.8.10-reiser4/fs/reiser4/context.h 2020-10-11 20:55:06.000000000 +0200 +++ linux-5.8.10/fs/reiser4/context.h 2020-12-12 16:46:39.000000000 +0100 @@ -64,6 +64,8 @@ unsigned int on_stack:1; /* file system is read-only */ unsigned int ro:1; + /* replacement of PF_FLUSHER */ + unsigned int flush_bd_task:1; /* count non-trivial jnode_set_dirty() calls */ unsigned long nr_marked_dirty; diff -urN linux-5.8.10-reiser4/fs/reiser4/super_ops.c linux-5.8.10/fs/reiser4/super_ops.c --- linux-5.8.10-reiser4/fs/reiser4/super_ops.c 2020-10-11 20:55:06.000000000 +0200 +++ linux-5.8.10/fs/reiser4/super_ops.c 2020-12-12 15:49:06.000000000 +0100 @@ -383,6 +383,7 @@ spin_lock(&wb->list_lock); goto skip; } + ctx->flush_bd_task = 1; /* * call reiser4_writepages for each of dirty inodes to turn * dirty pages into transactions if they were not yet. diff -urN linux-5.8.10-reiser4/fs/reiser4/txnmgr.c linux-5.8.10/fs/reiser4/txnmgr.c --- linux-5.8.10-reiser4/fs/reiser4/txnmgr.c 2020-10-11 20:55:06.000000000 +0200 +++ linux-5.8.10/fs/reiser4/txnmgr.c 2020-12-12 15:55:04.000000000 +0100 @@ -1413,7 +1413,7 @@ * Write throttling is case of no one atom can be * flushed/committed. */ - if (!current_is_flush_bd_task()) { + if (!ctx->flush_bd_task) { list_for_each_entry(atom, &tmgr->atoms_list, atom_link) { spin_lock_atom(atom); /* Repeat the check from the above. */ diff -urN linux-5.8.10-reiser4/include/linux/sched.h linux-5.8.10/include/linux/sched.h --- linux-5.8.10-reiser4/include/linux/sched.h 2020-10-11 20:55:06.000000000 +0200 +++ linux-5.8.10/include/linux/sched.h 2020-12-12 15:58:22.000000000 +0100 @@ -1483,7 +1483,6 @@ /* * Per process flags */ -#define PF_FLUSHER 0x00000001 /* responsible for disk writeback */ #define PF_IDLE 0x00000002 /* I am an IDLE thread */ #define PF_EXITING 0x00000004 /* Getting shut down */ #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ diff -urN linux-5.8.10-reiser4/include/linux/writeback.h linux-5.8.10/include/linux/writeback.h --- linux-5.8.10-reiser4/include/linux/writeback.h 2020-10-11 20:59:43.000000000 +0200 +++ linux-5.8.10/include/linux/writeback.h 2020-12-12 15:30:43.000000000 +0100 @@ -17,12 +17,6 @@ DECLARE_PER_CPU(int, dirty_throttle_leaks); -static inline int is_flush_bd_task(struct task_struct *task) -{ - return task->flags & PF_FLUSHER; -} -#define current_is_flush_bd_task() is_flush_bd_task(current) - /* * The 1/4 region under the global dirty thresh is for smooth dirty throttling: *