Commit c593e897 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fix from Chris Mason:
 "I had this in my 3.16 merge window queue, but it is small and obvious
  enough for 3.15.  I cherry-picked and retested against current rc8"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: send, fix corrupted path strings for long paths
parents 052e5c7e 01a9a8a9
...@@ -360,10 +360,13 @@ static int fs_path_ensure_buf(struct fs_path *p, int len) ...@@ -360,10 +360,13 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
/* /*
* First time the inline_buf does not suffice * First time the inline_buf does not suffice
*/ */
if (p->buf == p->inline_buf) if (p->buf == p->inline_buf) {
tmp_buf = kmalloc(len, GFP_NOFS); tmp_buf = kmalloc(len, GFP_NOFS);
else if (tmp_buf)
memcpy(tmp_buf, p->buf, old_buf_len);
} else {
tmp_buf = krealloc(p->buf, len, GFP_NOFS); tmp_buf = krealloc(p->buf, len, GFP_NOFS);
}
if (!tmp_buf) if (!tmp_buf)
return -ENOMEM; return -ENOMEM;
p->buf = tmp_buf; p->buf = tmp_buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment