]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: fix bch2_debugfs_flush_buf() when tabstops are in use
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 17 May 2025 23:53:50 +0000 (19:53 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:15:05 +0000 (20:15 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/debug.c

index 4ee5d486b305cf3675fc6627afb8d9348de3fa00..4fa70634c90e1f80bad9a49348210af0359c16ee 100644 (file)
@@ -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;
        }