If we have a long line that has to be dynamically allocated, we need to
adjust m_log_buf_pos accordingly afterward. In particular,
_write_and_copy does this adjustment, which means the later += line_used
is not only unnecessary but very bad, since line_used is > MAX_LOG_BUF.
Simplify all of this by getting rid of _write_and_copy: if we are writing
a big chunk let's just send the whole thing to m_fd and not bother keeping
the tail of it around for later.
Fix _log_safe_write to write the passed buffer, not m_log_buf.
Replace the paranoid check with a simple assert.
Fixes: 65da5ba216cafb8a91893d0e7fc092209f0fb286 Fixes: https://github.com/ceph/ceph/pull/23422 Signed-off-by: Sage Weil <sage@redhat.com>