btrfs-progs: fix copy-n-paste error checking

copy_one_inline() meant to test the return of pwrite() with ram_size.
Presumably the comparison with len was copied from the test earlier in
the function.

Signed-off-by: Zach Brown <zab@redhat.com>
master
Zach Brown 2013-01-17 16:36:48 -08:00
parent d86394da23
commit ba4791fde3
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ static int copy_one_inline(int fd, struct btrfs_path *path, u64 pos)
done = pwrite(fd, outbuf, ram_size, pos);
free(outbuf);
if (done < len) {
if (done < ram_size) {
fprintf(stderr, "Short compressed inline write, wanted %d, "
"did %zd: %d\n", ram_size, done, errno);
return -1;