Re: [RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-19 Thread Zhihao Cheng
在 2023/7/19 22:38, Ard Biesheuvel 写道: On Wed, 19 Jul 2023 at 16:23, Zhihao Cheng wrote: 在 2023/7/19 16:33, Ard Biesheuvel 写道: On Wed, 19 Jul 2023 at 00:38, Eric Biggers wrote: On Tue, Jul 18, 2023 at 02:58:31PM +0200, Ard Biesheuvel wrote: Currently, the ubifs code allocates a worst case

Re: [RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-19 Thread Zhihao Cheng
在 2023/7/19 16:33, Ard Biesheuvel 写道: On Wed, 19 Jul 2023 at 00:38, Eric Biggers wrote: On Tue, Jul 18, 2023 at 02:58:31PM +0200, Ard Biesheuvel wrote: Currently, the ubifs code allocates a worst case buffer size to recompress a data node, but does not pass the size of that buffer to the comp

Re: [RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-19 Thread Ard Biesheuvel
On Wed, 19 Jul 2023 at 16:23, Zhihao Cheng wrote: > > 在 2023/7/19 16:33, Ard Biesheuvel 写道: > > On Wed, 19 Jul 2023 at 00:38, Eric Biggers wrote: > >> > >> On Tue, Jul 18, 2023 at 02:58:31PM +0200, Ard Biesheuvel wrote: > >>> Currently, the ubifs code allocates a worst case buffer size to > >>> r

Re: [RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-19 Thread Ard Biesheuvel
On Wed, 19 Jul 2023 at 00:38, Eric Biggers wrote: > > On Tue, Jul 18, 2023 at 02:58:31PM +0200, Ard Biesheuvel wrote: > > Currently, the ubifs code allocates a worst case buffer size to > > recompress a data node, but does not pass the size of that buffer to the > > compression code. This means th

Re: [RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-18 Thread Eric Biggers
On Tue, Jul 18, 2023 at 02:58:31PM +0200, Ard Biesheuvel wrote: > Currently, the ubifs code allocates a worst case buffer size to > recompress a data node, but does not pass the size of that buffer to the > compression code. This means that the compression code will never use > the additional space

[RFC PATCH 05/21] ubifs: Pass worst-case buffer size to compression routines

2023-07-18 Thread Ard Biesheuvel
Currently, the ubifs code allocates a worst case buffer size to recompress a data node, but does not pass the size of that buffer to the compression code. This means that the compression code will never use the additional space, and might fail spuriously due to lack of space. So let's multiply out