[PATCH 6.1 099/106] ring-buffer: Fix writing to the buffer with max_data_size