[PATCHSET 5/6] thread_with_file: cleanups and fixes

From: Darrick J. Wong
Date: Fri Feb 23 2024 - 20:09:05 EST


Hi all,

This series fixes some problems with the thread_with_file code -- namely
that blocking stdout writes attempt a non-atomic memory allocation while
holding a spinlock. It also cleans up the ops handling so that we can
support ioctls on the thread_with_file itself.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=twf-cleanups
---
Commits in this patchset:
* thread_with_file: allow creation of readonly files
* thread_with_file: fix various printf problems
* thread_with_file: create ops structure for thread_with_stdio
* thread_with_file: allow ioctls against these files
* thread_with_file: Fix missing va_end()
---
fs/bcachefs/chardev.c | 18 ++++--
include/linux/thread_with_file.h | 20 +++++--
lib/thread_with_file.c | 113 ++++++++++++++++++++++++++++++--------
3 files changed, 115 insertions(+), 36 deletions(-)