#
d37dd9b6 |
| 30-May-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: bch2_stdio_redirect_readline_timeout()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
#
0c97c437 |
| 30-May-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: twf: convert bch2_stdio_redirect_readline() to darray
We now read the line from the buffer atomically, which means we have to allow the buffer to grow past STDIO_REDIRECT_BUFSIZE if we're
bcachefs: twf: convert bch2_stdio_redirect_readline() to darray
We now read the line from the buffer atomically, which means we have to allow the buffer to grow past STDIO_REDIRECT_BUFSIZE if we're waiting for a full line - this behaviour is necessary for stdio_redirect_readline_timeout() in the next patch.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
02bed83d |
| 16-Apr-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: Fix null ptr deref in twf from BCH_IOCTL_FSCK_OFFLINE
We need to initialize the stdio redirects before they're used.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
#
da23795e |
| 18-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_file: add f_ops.flush
Add a flush op, to return the exit code via close().
Also update bcachefs usage to use this to return fsck exit codes.
Signed-off-by: Kent Overstreet <k
bcachefs: thread_with_file: add f_ops.flush
Add a flush op, to return the exit code via close().
Also update bcachefs usage to use this to return fsck exit codes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
6b333129 |
| 14-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_file: Fix missing va_end()
Fixes: https://lore.kernel.org/linux-bcachefs/202402131603.E953E2CF@keescook/T/#u Reported-by: coverity scan Signed-off-by: Kent Overstreet <kent.ove
bcachefs: thread_with_file: Fix missing va_end()
Fixes: https://lore.kernel.org/linux-bcachefs/202402131603.E953E2CF@keescook/T/#u Reported-by: coverity scan Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
658a1e42 |
| 10-Feb-2024 |
Darrick J. Wong <djwong@kernel.org> |
bcachefs: thread_with_file: allow ioctls against these files
Make it so that a thread_with_stdio user can handle ioctls against the file descriptor.
Signed-off-by: Darrick J. Wong <djwong@kernel.or
bcachefs: thread_with_file: allow ioctls against these files
Make it so that a thread_with_stdio user can handle ioctls against the file descriptor.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
ab6752e2 |
| 10-Feb-2024 |
Darrick J. Wong <djwong@kernel.org> |
bcachefs: thread_with_file: create ops structure for thread_with_stdio
Create an ops structure so we can add more file-based functionality in the next few patches.
Signed-off-by: Darrick J. Wong <d
bcachefs: thread_with_file: create ops structure for thread_with_stdio
Create an ops structure so we can add more file-based functionality in the next few patches.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
1cbae651 |
| 07-Feb-2024 |
Darrick J. Wong <djwong@kernel.org> |
bcachefs: thread_with_file: fix various printf problems
Experimentally fix some problems with stdio_redirect_vprintf by creating a MOO variant with which we can experiment. We can't do a GFP_KERNEL
bcachefs: thread_with_file: fix various printf problems
Experimentally fix some problems with stdio_redirect_vprintf by creating a MOO variant with which we can experiment. We can't do a GFP_KERNEL allocation while holding the spinlock, and I don't like how the printf function can silently truncate the output if memory allocation fails.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
fcb1620e |
| 07-Feb-2024 |
Darrick J. Wong <djwong@kernel.org> |
bcachefs: thread_with_file: allow creation of readonly files
Create a new run_thread_with_stdout function that opens a file in O_RDONLY mode so that the kernel can write things to userspace but user
bcachefs: thread_with_file: allow creation of readonly files
Create a new run_thread_with_stdout function that opens a file in O_RDONLY mode so that the kernel can write things to userspace but userspace cannot write to the kernel. This will be used to convey xfs health event information to userspace.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
a5a650d6 |
| 09-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: suppress hung task warning
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
#
8f9320d3 |
| 09-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: Mark completed in ->release()
This fixes stdio_redirect_read() getting stuck, not noticing that the pipe has been closed.
Signed-off-by: Kent Overstreet <kent.overstree
bcachefs: thread_with_stdio: Mark completed in ->release()
This fixes stdio_redirect_read() getting stuck, not noticing that the pipe has been closed.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
032b3fd0 |
| 03-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: Thread with file documentation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
#
f704f108 |
| 05-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: fix bch2_stdio_redirect_readline()
This fixes a bug where we'd return data without waiting for a newline, if data was present but a newline was not.
Signed-off-by: Kent
bcachefs: thread_with_stdio: fix bch2_stdio_redirect_readline()
This fixes a bug where we'd return data without waiting for a newline, if data was present but a newline was not.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
a6777ca4 |
| 05-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: kill thread_with_stdio_done()
Move the cleanup code to a wrapper function, where we can call it after the thread_with_stdio fn exits.
Signed-off-by: Kent Overstreet <ke
bcachefs: thread_with_stdio: kill thread_with_stdio_done()
Move the cleanup code to a wrapper function, where we can call it after the thread_with_stdio fn exits.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
60e1baa8 |
| 05-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: convert to darray
- eliminate the dependency on printbufs, so that we can lift thread_with_file for use in xfs - add a nonblocking parameter to stdio_redirect_print
bcachefs: thread_with_stdio: convert to darray
- eliminate the dependency on printbufs, so that we can lift thread_with_file for use in xfs - add a nonblocking parameter to stdio_redirect_printf(), and either block if the buffer is full or drop it on the floor - don't buffer infinitely
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
e017047f |
| 05-Feb-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: thread_with_stdio: eliminate double buffering
The output buffer lock has to be a spinlock so that we can write to it from interrupt context, so we can't use a direct copy_to_user; this swi
bcachefs: thread_with_stdio: eliminate double buffering
The output buffer lock has to be a spinlock so that we can write to it from interrupt context, so we can't use a direct copy_to_user; this switches thread_with_file_read() to use fault_in_writeable() and copy_to_user_nofault(), similar to how thread_with_file_write() works.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
show more ...
|
#
dd839f31 |
| 04-Feb-2024 |
Mathias Krause <minipli@grsecurity.net> |
bcachefs: install fd later to avoid race with close
Calling fd_install() makes a file reachable for userland, including the possibility to close the file descriptor, which leads to calling its 'rele
bcachefs: install fd later to avoid race with close
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>
show more ...
|
#
d641d4ca |
| 04-Jan-2024 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: no thread_with_file in userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
#
96f37eab |
| 31-Dec-2023 |
Kent Overstreet <kent.overstreet@linux.dev> |
bcachefs: factor out thread_with_file, thread_with_stdio
thread_with_stdio now knows how to handle input - fsck can now prompt to fix errors.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.d
bcachefs: factor out thread_with_file, thread_with_stdio
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>
show more ...
|