提交 1b2782c8 编写于 作者: D David Sterba 提交者: Josef Bacik

btrfs: send: fix old buffer length in fs_path_ensure_buf

In "btrfs: send: lower memory requirements in common case" the code to
save the old_buf_len was incorrectly moved to a wrong place and broke
the original logic.
Reported-by: NFilipe David Manana <fdmanana@gmail.com>
Signed-off-by: NDavid Sterba <dsterba@suse.cz>
Reviewed-by: NFilipe David Manana <fdmanana@gmail.com>
Signed-off-by: NJosef Bacik <jbacik@fb.com>
上级 176840b3
......@@ -346,6 +346,9 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
if (p->buf_len >= len)
return 0;
path_len = p->end - p->start;
old_buf_len = p->buf_len;
/*
* First time the inline_buf does not suffice
*/
......@@ -368,9 +371,6 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
p->buf_len = ksize(p->buf);
}
path_len = p->end - p->start;
old_buf_len = p->buf_len;
if (p->reversed) {
tmp_buf = p->buf + old_buf_len - path_len - 1;
p->end = p->buf + p->buf_len - 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册