From: Kent Overstreet Date: Sat, 17 May 2025 23:53:50 +0000 (-0400) Subject: bcachefs: fix bch2_debugfs_flush_buf() when tabstops are in use X-Git-Tag: v6.16-rc1~211^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c3fc7cca38459751489f5015f3282a64e452b7e;p=thirdparty%2Fkernel%2Flinux.git bcachefs: fix bch2_debugfs_flush_buf() when tabstops are in use Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index 4ee5d486b305c..4fa70634c90e1 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -320,6 +320,11 @@ ssize_t bch2_debugfs_flush_buf(struct dump_iter *i) i->buf.pos -= copied; memmove(i->buf.buf, i->buf.buf + copied, i->buf.pos); + if (i->buf.last_newline >= copied) + i->buf.last_newline -= copied; + if (i->buf.last_field >= copied) + i->buf.last_field -= copied; + if (copied != bytes) return -EFAULT; }