[PATCH 6.6 161/166] ring-buffer: Fix writing to the buffer with max_data_size