summaryrefslogtreecommitdiff
path: root/fs/bcachefs/thread_with_file.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-05bcachefs: install fd later to avoid race with closeMathias Krause1-1/+1
Calling fd_install() makes a file reachable for userland, including the possibility to close the file descriptor, which leads to calling its 'release' hook. If that happens before the code had a chance to bump the reference of the newly created task struct, the release callback will call put_task_struct() too early, leading to the premature destruction of the kernel thread. Avoid that race by calling fd_install() later, after all the setup is done. Fixes: 1c6fdbd8f246 ("bcachefs: Initial commit") Signed-off-by: Mathias Krause <minipli@grsecurity.net> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-06bcachefs: no thread_with_file in userspaceKent Overstreet1-0/+3
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-06bcachefs: factor out thread_with_file, thread_with_stdioKent Overstreet1-0/+296
thread_with_stdio now knows how to handle input - fsck can now prompt to fix errors. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>