aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-07 18:12:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-07 18:12:18 -0400
commitc593e8978722f7f4a12932733cfeed6c0c74fbaa (patch)
tree364ad0542f0208b161ad848281273354e6fc037d /fs
parent052e5c7e28cc22017f9ad3f67026f911fdfc2edc (diff)
parent01a9a8a9e20012f5676ec9cd16b6aed08b267066 (diff)
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
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/send.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index fd38b5053479..484aacac2c89 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -360,10 +360,13 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
360 /* 360 /*
361 * First time the inline_buf does not suffice 361 * First time the inline_buf does not suffice
362 */ 362 */
363 if (p->buf == p->inline_buf) 363 if (p->buf == p->inline_buf) {
364 tmp_buf = kmalloc(len, GFP_NOFS); 364 tmp_buf = kmalloc(len, GFP_NOFS);
365 else 365 if (tmp_buf)
366 memcpy(tmp_buf, p->buf, old_buf_len);
367 } else {
366 tmp_buf = krealloc(p->buf, len, GFP_NOFS); 368 tmp_buf = krealloc(p->buf, len, GFP_NOFS);
369 }
367 if (!tmp_buf) 370 if (!tmp_buf)
368 return -ENOMEM; 371 return -ENOMEM;
369 p->buf = tmp_buf; 372 p->buf = tmp_buf;